Start here · Getting going
Run MiniMax M3.1 Flash inside Claude Code
Written November 2, 2026
A $0.15-per-million model behind the harness you already know. Point Claude Code at MiniMax's endpoint, verify the switch, and route only routine work there.
What you are switching
MiniMax M3.1 Flash is a hosted model you reach through MiniMax's API, and Claude Code can be pointed at that API by changing two settings: the base URL and the auth token. Nothing about the harness changes — the same commands, the same session flow — but the model answering is MiniMax's, not Anthropic's. The metered rates on MiniMax's pricing page are $0.15 per million input tokens, $0.60 per million output tokens, and $0.015 per million prompt-caching reads, with no long-context surcharge stated for this model. The $0.15 in the headline is the input rate; output costs four times as much per token, so a session that writes a lot costs more than the headline suggests. Keep the hard work on the model you already trust, and give Flash the routine work where a wrong answer is cheap to catch: small edits, summaries, and first passes you plan to read anyway.
Before you change anything
Clear the two environment variables first: ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL. MiniMax's own setup docs warn that they take priority over the settings file and override the MiniMax configuration — a leftover Anthropic token in the environment silently wins over everything you are about to write. Remove both variables from ~/.bashrc and ~/.zshrc as well, not just the current shell, or the next terminal you open restores the override. Get a MiniMax API key before starting: the setup routes below use an M Plan API key, and the key goes in the settings file as the auth token.
Three ways to point Claude Code at MiniMax
Pick one route. They all end at the same settings; the wizard is the least typing, the settings file is the most explicit.
- Setup wizard. Run
npx -y mmx-cli@latest agent setupand select Claude Code. The wizard runs the official installer if needed, checks the Claude Code version, updates~/.claude/settings.json, and adds the MiniMax model list. - Edit the settings file. In
~/.claude/settings.json, set theenvblock to:ANTHROPIC_BASE_URL:https://api.minimax.io/anthropicANTHROPIC_AUTH_TOKEN: your MiniMax API keyCLAUDE_CODE_AUTO_COMPACT_WINDOW:524288CLAUDE_CODE_EFFORT_LEVEL:maxANTHROPIC_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_DEFAULT_OPUS_MODEL, andANTHROPIC_DEFAULT_HAIKU_MODEL: all set toMiniMax-M3.1-Flash[1m]
claudeand select Trust This Folder. The 512K compaction window is MiniMax's own recommendation in the setup docs, and the[1m]suffix names the long-context variant. - CC Switch. Install CC Switch from its Homebrew tap or cask, or from its GitHub Releases. Then select the MiniMax preset, enter the M Plan API key, set all model names to
MiniMax-M3.1-Flash, select Declare 1M, add the two environment entries, and enable it.
Check the switch worked
Do not trust the settings file alone — the environment-variable override in the previous section is exactly the failure that looks configured and is not. Inside Claude Code, run /status and confirm the base URL points to api.minimax.io/anthropic. Then run /model and confirm it shows MiniMax-M3.1-Flash. If either shows the old endpoint or the old model, the environment variables are still set somewhere: check the current shell, then the shell startup files, then the settings file. Only when both checks show MiniMax is the switch real.
Thinking and effort work differently here
Thinking is always enabled on this model and cannot be disabled. Settings that turn thinking off, such as MAX_THINKING_TOKENS=0, have no effect. Effort runs on five levels — low, medium, high, xhigh, max — and the examples default to max, or high when the effort variable is not set. While CLAUDE_CODE_EFFORT_LEVEL is set, the in-session /effort command has no effect; remove the variable to switch effort per session. The practical consequence: this model always spends thinking effort, so "cheap" refers to the token price, not to the amount of thinking. Routine work stays cheap because the price is low, not because the model thinks less.
Metered rates or M Plan
There are two ways to pay. The metered rates above — $0.15 in, $0.60 out, $0.015 cache read, per million tokens — are on MiniMax's pricing page and are the countable option: light or occasional use can be priced exactly. M Plan is MiniMax's subscription for individuals, in three tiers called Go, Explore, and Build, with M3.1 Flash as the text model on all three, video on Explore and Build only, and usage quotas relative to Go of 1×, 3×, and 7.5×. MiniMax's M Plan pages name the tiers and the quotas but carry no price and no usage-window durations, so no price or window is quoted here. Check the current M Plan terms on MiniMax's site before choosing, and compare them against your actual token use at the metered rates — a subscription is only cheaper past the usage level where its quota beats the meter.
What can go wrong
- A leftover environment variable silently wins. The settings file looks right, the session runs, and the model is still Anthropic's. The
/statuscheck exists for exactly this failure. - Setting only some of the four model variables. Each of the four model slots falls back to its own default. Leave one on the old model and part of the session runs somewhere you did not intend, at a price you did not intend.
- Expecting
/effortto work while the effort variable is set. It has no effect until the variable is removed. Effort that will not change is usually this, not a broken install. - Trying to turn thinking off. It cannot be disabled on this model, and settings that claim to do so are ignored. Budget for thinking effort on every task.
- Quoting a subscription price from a write-up. M Plan prices and windows circulate in secondary coverage, but MiniMax's own pages do not state them. A price from a write-up is a price from a write-up, not from MiniMax.
- Assuming the model behaves like the one it replaced. Nothing in the setup docs claims equivalent behaviour. Route only work where you read the result anyway, and judge the model on your own tasks before widening its share.
Limits
- The rates quoted are the metered rates on MiniMax's pricing page. M Plan terms, including price and any usage windows, are not stated on MiniMax's M Plan pages; check MiniMax's site at the time you choose.
- The setup docs cover the hosted API route only. They say nothing about the model's quality against any other model, about licences, or about weight availability.
- Thinking is always on, so token use per task includes thinking effort. A price comparison that counts only input and output tokens understates the bill.
Related playbooks
- Check Copilot cloud sandbox billing first
- Pick the cheapest model for the job
- What an agent costs, in plain figures
- Run three independent lines of research at the same time in Claude Code, then combine the short summaries
Sources
- https://platform.minimax.io/docs/m-plan/claude-code
- https://platform.minimax.io/docs/pricing/overview
- https://platform.minimax.io/docs/guides/pricing-token-plan
Back to: Start here · Coding playbooks hub · Also: Pick the cheapest model for the job · What an agent costs, in plain figures · Run a 24B agent locally, if your hardware allows