Run Claude Code on MiniMax-M3 and MiniMax-M2.7
Keep the Claude Code workflow, pay MiniMax prices: three environment variables connect Claude Code to MiniMax through an Anthropic-compatible endpoint.
Why run Claude Code on MiniMax
Claude Code talks to any server that speaks the Anthropic Messages API. YiduoChan exposes MiniMax-M3 and MiniMax-M2.7 through exactly that protocol, so you keep the Claude Code workflow, agents and tools while paying MiniMax prices: MiniMax-M2.7 costs $0.3134 per million input tokens and $1.2537 per million output tokens, and MiniMax-M3 gives you a 1,048,576-token context for whole-repository work at the same rate in the ≤512K tier.
Setup with environment variables
# 1. Get an API key at https://yiduochan.com/register
# 2. Point Claude Code at the Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL=https://yiduochan.com
export ANTHROPIC_AUTH_TOKEN=YIDUOCHAN_API_KEY
export ANTHROPIC_MODEL=MiniMax-M2.7
export ANTHROPIC_SMALL_FAST_MODEL=MiniMax-M2.7-highspeed
# 3. Start Claude Code as usual
claude
Setup with settings.json
Put the same values in ~/.claude/settings.json (or the project's .claude/settings.json) for a persistent configuration:
{
"env": {
"ANTHROPIC_BASE_URL": "https://yiduochan.com",
"ANTHROPIC_AUTH_TOKEN": "YIDUOCHAN_API_KEY",
"ANTHROPIC_MODEL": "MiniMax-M3",
"ANTHROPIC_SMALL_FAST_MODEL": "MiniMax-M2.7-highspeed"
}
}
Which model to choose
| Model | Best for | Price per 1M tokens |
|---|---|---|
| MiniMax-M3 | Large repositories, long sessions, deep reasoning; 1M context | $0.3134 in / $1.2537 out (≤512K), $0.6269 / $2.5075 above 512K |
| MiniMax-M2.7 | Everyday coding, edits, refactors | $0.3134 in / $1.2537 out |
| MiniMax-M2.7-highspeed | Fast helper model for file summaries and quick tool calls | $0.6269 in / $2.5075 out |
Prompt caching is automatic: repeated context is billed at the cache-read rate of $0.0627 per million tokens, which matters for Claude Code's long, repetitive system prompts.
Verify the connection
curl https://yiduochan.com/v1/messages \
-H "x-api-key: $YIDUOCHAN_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "MiniMax-M2.7", "max_tokens": 64, "messages": [{"role": "user", "content": "Say hello"}]}'
Other Anthropic-compatible tools
- Cline / Roo Code: choose the Anthropic provider, set the base URL to
https://yiduochan.comand enter the model name manually. - Anthropic SDKs: construct the client with
base_url="https://yiduochan.com"and your key. - OpenAI-compatible tools such as Cursor or Continue use
https://yiduochan.com/v1instead; see the MiniMax-M2.7 guide.
FAQ
Does Claude Code work with MiniMax models?
Yes. Set ANTHROPIC_BASE_URL to https://yiduochan.com, ANTHROPIC_AUTH_TOKEN to your key and ANTHROPIC_MODEL to MiniMax-M2.7 or MiniMax-M3; Claude Code then sends its Anthropic Messages requests to MiniMax through this relay.
Which MiniMax model is best for Claude Code?
MiniMax-M2.7 is the everyday choice; switch to MiniMax-M3 when you need the 1M context for large codebases. Use MiniMax-M2.7-highspeed as the small fast model.
How much does Claude Code on MiniMax cost?
You pay per token at MiniMax rates: $0.3134 per million input and $1.2537 per million output tokens for MiniMax-M2.7, with cache reads at $0.0627. There is no subscription.
Do tools and agents still work?
Yes. The relay forwards tool definitions, tool results and streaming through the Anthropic Messages format, so Claude Code's file edits, shell commands and sub-agents behave as usual.