MiniMax built the M2 family specifically for agentic coding — a compact mixture-of-experts design that keeps latency low while running multi-step tasks end to end. M2.5 is one of the cheapest credible models for exactly the kind of work Claude Code does, which makes the pairing attractive if cost and responsiveness both matter.
This covers connecting MiniMax to Claude Code, the model and mode choices, and the pricing picture. For the routing options generally, see use cheap AI models with Claude Code.
Step 1: Get a MiniMax API key
Sign up on the MiniMax platform and create an API key. Add a little credit — the rates are low, so it lasts.
Step 2: Connect to Claude Code
There are two paths, depending on what MiniMax exposes:
If MiniMax offers an Anthropic-compatible endpoint (check its docs), point Claude Code straight at it:
export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-minimax-key"
export ANTHROPIC_MODEL="minimax-m2.5"
claude
Otherwise, use Claude Code Router with MiniMax’s OpenAI-compatible endpoint as a provider:
{
"Providers": [
{
"name": "minimax",
"api_base_url": "https://api.minimax.io/v1/chat/completions",
"api_key": "$MINIMAX_API_KEY",
"models": ["minimax-m2.5"]
}
],
"Router": { "default": "minimax,minimax-m2.5" }
}
Step 3: Model and mode
MiniMax models for coding
| minimax-m2.5 | Flagship agentic coding model; cheap |
|---|---|
| minimax-m2 | Earlier compact agentic model |
| lightning mode | Higher throughput, same quality (if available) |
M2.5 is the agentic coding pick. If a lightning/high-throughput mode is offered, it keeps the agent loop snappy.
Pricing
MiniMax positions M2.5 as a fraction of frontier-model cost — low input and output rates per million tokens — with automatic caching that helps in agent sessions. It offers pay-per-token and, for some products, subscription plans. Confirm the current rates and any plan on MiniMax’s pricing overview, since they change.
Verify
claude
# then: "implement a small feature across these files and run the tests"
If it works through the multi-step task cleanly, MiniMax is serving Claude Code.
Troubleshooting
- Auth errors — token/key not set in the current shell.
- Format errors — if using the Anthropic path, confirm it’s the
/anthropicendpoint; if using the router, confirm the OpenAI endpoint and any needed transformer. - “Model not found” — verify the current model ID on MiniMax’s docs.
- Config not applied (router) — run
ccr restart.
MiniMax + Claude Code checklist
- MiniMax API key created and funded
- Claude Code installed
- Connected via Anthropic endpoint or Claude Code Router
- Model set to minimax-m2.5 (verify ID)
- Tested on a multi-step task
Wrapping up
MiniMax M2.5 is a cheap, agentic-focused model that suits Claude Code’s multi-step work well. Connect it via an Anthropic-compatible endpoint if MiniMax offers one, or through Claude Code Router otherwise, set the model, and you’ve got responsive agentic coding at a fraction of frontier cost. Verify the current endpoints and rates on MiniMax’s docs.
To use it in a terminal agent instead, see MiniMax M2 + OpenCode; to compare, see MiniMax vs DeepSeek vs GLM.