Skip to content

feat(mistral): Add Mistral.AI Vibe & API quota check - #488

Open
huzky-v wants to merge 1 commit into
slkiser:mainfrom
huzky-v:feat/provider-mistral-ai
Open

huzky-v wants to merge 1 commit into
slkiser:mainfrom
huzky-v:feat/provider-mistral-ai

Conversation

@huzky-v

@huzky-v huzky-v commented Nov 16, 2026

Copy link
Copy Markdown

What users see change

Adds Mistral AI as provider to get the quota, and it will detect what is the key type of the subscription (Vibe / API)

Logic Flow:

  1. endpoint: GET https://console.mistral.ai/api/vibe/whoami
{
  "plan_type": "CHAT",
  "plan_name": "EDU",
  "prompt_switching_to_pro_plan": false,
  "organization_kind": "S",
  "customer_id": "x",
  "api_base": "https://api.mistral.ai",
  "vibe_base": "https://chat.mistral.ai",
  "primitive_access_scope": "personal_and_shared"
}

For plan_type: "chat" => show vibe_budget (This is Vibe Key)
For plan_type: "api" => show api_budget (This is API Key)

  1. the quota is from GET https://api.mistral.ai/v1/billing/budget passing the API key in bearer token
{
  "vibe_budget": {
    "usage_percentage": 0.0,
    "initial_budget": 150.0,
    "currency": "USD",
    "reset_at": "2026-12-01T00:00:00Z",
    "payg_enabled": false
  },
  "api_budget": {
    "usage_percentage": 0.0,
    "initial_budget": 15.0,
    "currency": "USD",
    "reset_at": "2026-12-01T00:00:00Z",
    "payg_enabled": false
  },
  "usage_percentage": 0.0,
  "initial_budget": 15.0,
  "currency": "USD",
  "reset_at": "2026-12-01T00:00:00Z"
} 

the usage_percentage and reset date is in the dataset, and get the corresponding object for the key type

Linked issue

N/A

Before and after screenshots

螢幕截圖 2026-11-16 22 39 20

Checklist

  • I ran pnpm verify
  • I tested on released OpenCode version: 2.3.0
  • For provider changes, I followed Provider Changes, or this does not apply

It is requested by me only, not sure if anyone need Mistral to be supported.

@github-actions github-actions Bot added the feature New feature or behavior change label Nov 16, 2026
@huzky-v
huzky-v force-pushed the feat/provider-mistral-ai branch from 5737574 to 88e546b Compare November 23, 2026 09:12
@yunjianj

Copy link
Copy Markdown

I would also like to use Mistral quota tracking in opencode-quota. Support for the Mistral Vibe and API budgets would be useful to me. Thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants