Docs · Provider

Mistral in Claude Code, Codex, Gemini CLI and OpenCode

Mistral serves its models on one API, OpenAI-style Chat Completions, at api.mistral.ai. Add a Mistral API key to packinggoods once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Mistral through packinggoods’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Agents that speak another API are translated on the way.

Add Mistral

  1. Get a keyMake one on console.mistral.ai. A Le Chat plan’s Vibe key goes in the same provider.
  2. Add the providerIn packinggoods’s Providers tab, press + Add provider, pick Mistral, paste the key and save. packinggoods asks Mistral which models the key can use.
  3. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose a Mistral model such as mistral-large-4.
Terminal
packinggoods provider add mistral <key>
packinggoods provider test mistral

Model ids in packinggoods are provider/model, so Mistral’s read mistral/mistral-large-4: the provider, then Mistral’s own id. The key is kept in packinggoods’s settings; packinggoods doesn’t take it from your shell.

Already set Mistral up in OpenCode or Alma? packinggoods’s import from those apps brings it in as the Mistral provider. An app that keeps one entry per key (“Mistral #0001”, “Mistral #0002”…) becomes one Mistral provider with that many keys, listed once in every agent’s picker.

Endpoints

APIAddressUsed for
Chat Completionshttps://api.mistral.ai/v1the model list and every agent’s requests: OpenCode’s as they are, Claude Code’s, Codex’s and Gemini CLI’s translated
Billinghttps://api.mistral.ai/v1/billing/budget, /v1/billing/subscriptiona key’s month of Vibe or API budget, and the plan it is on

packinggoods’s Mistral provider has no Anthropic Messages or Responses address, so an agent that speaks either is translated to Chat Completions and the reply translated back, streaming and tool calls included.

Model list

packinggoods fetches the list from Mistral, at https://api.mistral.ai/v1/models, so agents see the models your key can use. Names, reasoning levels and prices come from models.dev’s mistral catalog, and Devstral, Codestral and Magistral models carry Mistral’s logo in every picker. Mistral also serves models from other labs, such as GLM and DeepSeek’s deepseek-v4.1-flash-1017; they come through the same key, and the fixes below apply to them too. Pick the models agents see in the provider’s model list, or from the terminal:

Terminal
packinggoods provider models mistral +mistral-large-4 +mistral-medium-3.5
packinggoods provider refresh-every mistral 1d

In each agent

Terminal
packinggoods claude mistral/mistral-large-4
packinggoods codex mistral/mistral-large-4
packinggoods gemini model mistral/mistral-large-4
packinggoods opencode mistral/mistral-large-4

What packinggoods fixes for Mistral

Mistral’s API is strict about what it takes and sends a reasoning model’s thinking in a shape of its own. packinggoods changes both on the way, on requests it passes on and on those it translates alike:

Reasoning

Mistral’s Chat Completions API doesn’t search the web for packinggoods, so packinggoods gives the model its own search tool in every agent, answered by the searcher chosen in Settings, or by one packinggoods picks when none is chosen.

Vibe, cost and usage

Several keys and failover

One Mistral provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over.

Terminal
packinggoods provider spend-cap mistral <key> 20 month
packinggoods provider key-balance mistral <key> 25
packinggoods provider fallback mistral deepseek/deepseek-v4-pro

Troubleshooting

Groq in Claude Code, Codex and other agents

FAQ

How do I use Mistral in Claude Code?

Add your Mistral API key in packinggoods (Providers, Add provider, Mistral), then pick a Mistral model such as mistral-large-4 on Claude Code’s row, or run packinggoods claude mistral/mistral-large-4. Mistral serves Chat Completions only, so packinggoods translates Claude Code’s Anthropic Messages requests to https://api.mistral.ai/v1 and the replies back, thinking included.

Can Codex use Devstral and other Mistral models?

Yes. Codex can use any model your Mistral key lists, Devstral among them. Codex speaks OpenAI Responses, which Mistral doesn’t serve, so packinggoods translates each request to Chat Completions, offers Codex’s custom tools such as apply_patch as functions, and gives the calls back the way Codex runs them.

How do I use Codestral or other Mistral models in OpenCode?

Pick the model in packinggoods, or run packinggoods opencode mistral/mistral-large-4; Codestral and Devstral work the same way when your key lists them. OpenCode speaks Chat Completions, so its requests go to Mistral as they are, with what Mistral would refuse fixed on the way: OpenCode’s store field, and earlier turns’ thinking sent back in reasoning_content.

Can Gemini CLI use Mistral?

Yes. Gemini CLI speaks Google’s Gemini API, so packinggoods translates its requests to Mistral’s Chat Completions and the replies back, streaming and tool calls included. Run packinggoods gemini model mistral/mistral-large-4.

Why does Mistral answer 422 extra_forbidden?

Mistral turns away any field it doesn’t know. packinggoods sends an earlier turn’s thinking as the thinking part Mistral takes, leaves out Ollama options some agents add, and asks again without an optional field Mistral names, such as OpenCode’s store, then stops sending it.

Does packinggoods show my Le Chat plan’s Vibe budget?

Yes. A Vibe key from a Le Chat plan (Pro, Student or Team) shows how much of the month’s Vibe budget is used, in the currency Mistral bills in, and when it resets, with the plan’s name. A Studio key made in the console shows the organization’s API budget instead, as “API · Month”.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · OpenRouter · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.