Docs · Provider
MiniMax and the MiniMax Coding Plan in Claude Code, Codex, Gemini CLI and OpenCode
MiniMax serves an OpenAI-compatible Chat API and an Anthropic-compatible one, on a global site and a China site, for pay-as-you-go keys and Coding Plan keys alike. Add your key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use models such as MiniMax-M3 and MiniMax-M2.7 through magpie’s gateway at 127.0.0.1:3425.
Add MiniMax
- Get a keyCreate one at platform.minimax.io, or platform.minimaxi.com for the China site. A Coding Plan key starts with
sk-cp-. - Add the providerIn magpie’s Providers tab, press + Add provider, pick MiniMax or MiniMax (China), paste the key and save. A pay-as-you-go key and a Coding Plan key go in the same way.
- Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose a MiniMax model.
magpie provider add minimax sk-… # platform.minimax.io magpie provider add minimax-cn sk-cp-… # Coding Plan, platform.minimaxi.com
Plans and endpoints
| Preset | Site | Chat Completions | Anthropic Messages |
|---|---|---|---|
| MiniMax minimax | platform.minimax.io | https://api.minimax.io/v1 | https://api.minimax.io/anthropic |
| MiniMax (China) minimax-cn | platform.minimaxi.com | https://api.minimaxi.com/v1 | https://api.minimaxi.com/anthropic |
The Coding Plan uses the same endpoints as pay as you go; the key decides which one a request is billed to. A global key and a China key are different accounts, so each goes under its own site’s preset.
In each agent
Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what magpie writes in that agent’s config and how to switch back.
magpie claude minimax/MiniMax-M3 magpie codex minimax/MiniMax-M3 magpie gemini model minimax/MiniMax-M2.7 magpie opencode minimax/MiniMax-M3
- Claude Code speaks Anthropic Messages, and so does MiniMax’s Anthropic endpoint, so its requests are passed on as they are. Every tier (opus, sonnet, haiku) runs on the model you pick unless you give one its own. Models in Claude Code.
- Codex speaks only OpenAI Responses. MiniMax serves Chat Completions and Anthropic Messages but not Responses, so magpie translates each request and the reply, streaming and tool calls included. The model shows in Codex’s
/modelwith its reasoning efforts. Models in Codex. - Gemini CLI speaks Gemini’s API. magpie points it at its gateway and translates. Models in Gemini CLI.
- OpenCode gets the model in
opencode.json, with its reasoning variants and cost. Models in OpenCode.
MiniMax Code is one of the agents magpie connects too: its row takes MiniMax’s models or any other vendor’s.
Thinking and effort
- Interleaved thinking. MiniMax’s Chat API gives a model’s thinking in the reply text, between
<think>tags, and wants it back there on later turns. magpie hands it to the agent as thinking and puts it back where MiniMax expects it. - Effort.
MiniMax-M3.1-Flashand its preview think at levels from low to max. magpie sends the level an agent asks for inoutput_config.effort, as MiniMax Code does, so it isn’t lost to a token budget. - Models that always think.
MiniMax-M3.1-Flash-Previewrefuses to have thinking turned off. When an agent asks for it off, magpie asks again with thinking left on, so the agent gets an answer rather than the error.
Coding Plan windows and usage
- Coding Plan windows. A Coding Plan key’s row shows what is left of each window MiniMax reports, a rolling one and a weekly one, read from MiniMax. Models draw on the general bucket; a bucket metered apart, such as video, shows as a count, like 4 / 5. A pay-as-you-go key has no windows and no card.
- Routing. With several Coding Plan keys, magpie weighs them by their windows and rests one that has used a window up until it resets.
- Usage. The Usage tab counts tokens, cache hits and cost for each agent and model that went through magpie.
FAQ
How do I use MiniMax M2.7 or M3 in Claude Code?
Add your MiniMax key in magpie (Providers, Add provider, MiniMax or MiniMax (China)), then pick a model such as MiniMax-M3 on Claude Code’s row, or run magpie claude minimax/MiniMax-M3. magpie writes Claude Code’s settings.json and passes its requests to MiniMax’s Anthropic endpoint, https://api.minimax.io/anthropic.
How do I use the MiniMax Coding Plan?
Add the Coding Plan key (sk-cp-…) to the MiniMax preset of the site you bought it on, the same as a pay-as-you-go key. magpie tells the two apart by what MiniMax says about the key, and shows a Coding Plan key’s usage windows on its row.
Can Codex use MiniMax?
Yes. MiniMax serves Chat Completions and Anthropic Messages but not Responses, so magpie translates Codex’s requests and MiniMax’s replies. Pick the model on Codex’s row or run magpie codex minimax/MiniMax-M3; it shows in Codex’s /model list.
Can MiniMax Code use other models?
Yes. MiniMax Code is one of the agents magpie connects, so its row in the Agents tab takes any model you have added, MiniMax’s or another vendor’s.
Why does MiniMax’s thinking show up in the text?
MiniMax’s Chat API puts a model’s thinking in the reply text between <think> tags. magpie takes it out and gives it to the agent as thinking, then puts it back on the next turns, where MiniMax wants it.
Can I use several MiniMax keys?
Yes. Add them all to the MiniMax provider and tick each one. magpie spreads requests over them, and weighs and rests Coding Plan keys by their windows, so a key that has used up its window sits out until it resets.
Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.