8216592a8 (v0.1.3109) read vibe_budget from api.mistral.ai/v1/billing/budget
for every key on api.mistral.ai. That budget is the organization's, not the
key's: a Vibe key and a Studio key made in the console of one organization
are told the same body, so dhanyqaz's Studio key (Student plan) showed the
Vibe month, 149.36 / 150, and "All 2 accounts" added the two into 298.72 /
300.
Which budget a key spends is its kind. Mistral's Vibe CLI asks
console.mistral.ai/api/vibe/whoami (plan_type CHAT, API or MISTRAL_CODE,
vibe/setup/auth/whoami.py at mistralai/mistral-vibe c96a6db) and reads the
Vibe budget of a CHAT key only (_account.py). magpie now asks whoami once a
key (kept by the key's hash): a Vibe key keeps vibe_budget as "Month"; a
Studio key gets the same body's api_budget (Vibe's own fixture in
tests/app_server/test_billing.py, "Producer: dashboard billing_api_public")
as "API · Month", Aside while the subscription's payg_enabled is on (Vibe's
uses vibe_payg_enabled). The names differ, so the accounts' strip never adds
a Studio month to a Vibe month. A key whoami can't place (a failed read, no
plan_type, Mistral Code) has no card read: the org's budget alone doesn't
say which of its two it spends. The unit stays the currency billing names
(dhanyqaz's USD came from the reply, as nothing in magpie writes USD for
Mistral); none when it names none. Only api.mistral.ai keys are touched;
every other plan source takes the same path as before.
Run (mote): go test ./internal/provider (whole package, ok);
go vet ./internal/provider ./internal/gui, GOOS=linux -tags nogui and
GOOS=windows vet; gofmt -l clean; usage-merge, i18n-keys, i18n-en-no-cjk,
gui-de, gui-ja, gui-zh-tw in Chromium and WebKit, all ok but
i18n-keys' "a plugin's words are its own", red the same on origin/main
0f07fbd0c (#5327, #5332, #5426; this change adds no plugin words).
Broken by hand: with readMistralBudget reading vibe_budget whatever the
kind, TestMistralStudioBudget goes red (the Studio window is 0.65 / 150
USD, Aside from the wrong flag, the same name as the Vibe month).
Not tried: a real Studio or Vibe key; none at hand. whoami's and
api_budget's shapes are Vibe's own code and fixtures, not a reply seen;
console.mistral.ai answers 401 to a bad key on any /api path, so the probe
doesn't prove the route. Two Vibe keys of one organization would still
each show the org's month and add up on the strip.
Reported-by: dhanyqaz