docs/mistral.md
CodexBar reads Mistral billing usage with the Mistral web session from admin.mistral.ai. It can also fetch credit
balance and, when the required CSRF/session cookies are present, best-effort Mistral Vibe monthly-plan usage.
Cookie: header from a request to
admin.mistral.ai.Manual cookies must include an ory_session_* cookie. A csrftoken cookie enables authenticated billing and Vibe
requests that require the X-CSRFTOKEN header.
CodexBar requests the current UTC month from Mistral Admin:
GET https://admin.mistral.ai/api/billing/v2/usage?month=<month>&year=<year>GET https://admin.mistral.ai/api/billing/credits (best-effort credit balance)When a CSRF token is available, CodexBar also makes a bounded best-effort request for Mistral Vibe plan usage:
GET https://console.mistral.ai/api-ui/trpc/billing.vibeUsage?...For the console request, CodexBar forwards only the csrftoken and ory_session_* cookies. Other
admin.mistral.ai cookies stay origin-bound.
codexbar usage --provider mistral --verbose
Sign in to Mistral Admin in Chrome, then refresh.
In manual mode, paste a full Cookie: header from an admin.mistral.ai request. The header must include an
ory_session_* cookie.
The billing usage request is required. Credits and Vibe usage are best-effort; if either optional endpoint fails or does not expose data for the account, CodexBar keeps the main Mistral usage result.
Sources/CodexBarCore/Providers/Mistral/MistralProviderDescriptor.swiftSources/CodexBarCore/Providers/Mistral/MistralUsageFetcher.swiftSources/CodexBarCore/Providers/Mistral/MistralModels.swiftSources/CodexBarCore/Providers/Mistral/MistralCookieImporter.swiftSources/CodexBar/Providers/Mistral/MistralProviderImplementation.swift