Claude Code
Use MiniMax M3.1 Flash in Claude Code
A reproducible coding task, a recorded China-endpoint result, and region-aware settings and troubleshooting.
What we actually tested
Our testing — 23 October 2026. Claude Code 2.1.308, Node 22.23.3, Linux, MiniMax-M3.1-Flash[1m], effort low, and the China endpoint https://api.minimax.cn/anthropic. We ran one small coding task in a temporary directory: read an invoice function and its tests, fix quantity handling, then run the tests. The starting implementation failed; the changed implementation passed all five checks, and the test file was unchanged. The outer harness independently reran the tests after Claude Code exited.
Download the recorded result and diff, test kit, or runner source. This establishes a small read/edit/test tool loop on that endpoint. It does not establish long-context reliability, image/video support in this harness, subscription billing, GUI behaviour, or comparative model quality. We have not tested the setup wizard.
The available key returned HTTP 401 at the international endpoint. We therefore cannot claim the international setup below passed our test. A key succeeding in China does not prove cross-region access or the cause of every 401.
Repeated coding tasks: time, tokens and completion
Our testing — 23 October 2026. A separate series uses three fixed tasks—pagination URL repair, CSV parsing and async retry—each attempted three times in a new directory. Claude Code 2.1.308 uses the China Anthropic endpoint, MiniMax-M3.1-Flash[1m] and effort low, with a 12-turn limit and an outer 195-second timeout. It can read the tests and run commands. The outer harness grades against the original tests rather than trusting the agent’s final message.
9/9 attempts passed the original checks. Protected test/specification files were unchanged. Median whole-process time was 22.96 seconds, with a range of 12.43–113.03 seconds.
| Task | Passed attempts | Median process time |
|---|---|---|
| pagination | 3/3 | 15.33 s |
| csv | 3/3 | 45.52 s |
| retry | 3/3 | 20.37 s |
Across all nine attempts, the CLI reported input_tokens=61,590, cache_read_input_tokens=223,499, cache_creation_input_tokens=0, and output_tokens=14,312. These are native harness fields, not token counts normalized against mcode or the direct API.
Wall time covers the whole CLI process, including startup, reasoning, tools and test execution. It is not API TTFT. Native input and output totals reflect this harness and repeated context; reported cache reads are shown separately. Reasoning, when present, is already within output tokens. We do not publish the CLI’s estimated dollars as a provider invoice.
Download all nine task records, the computed summary, or the full kit. Set MINIMAX_API_KEY for the China platform, then run:
python3 agents.py claude --output /tmp/claude-suite.jsonA successful fraction here describes these nine small attempts only, not a population completion rate. Tests are visible to the agent in this series; they are withheld in the separate single-response API comparison. Native mcode has its own account route and results, and API timing uses different measurement boundaries.
Choose your region and key first
Official. The international guide uses https://api.minimax.io/anthropic; the China guide uses https://api.minimax.cn/anthropic. Use the key and endpoint for your platform. Our English examples default to the international service. For M Plan, use the Subscription Key from Plan Details; a pay-as-you-go API key uses separate billing. See M Plan and API access.
Before changing a working installation, back up ~/.claude/settings.json and check inherited provider variables. MiniMax warns that shell exports of ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN override its settings-file configuration. In the shell where you intend to use the file:
unset ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_BASE_URLCheck your shell startup files if those values return in a new terminal. Do not ask the model to reveal your key or infer the endpoint from its answer.
Option 1: the official setup wizard
npx -y mmx-cli@latest agent setupSelect Claude Code. According to MiniMax, the wizard can install a missing agent, check its version, back up and update its settings, and add the model list. This is an Official workflow, not one we reproduced. Review what it changes when switching an existing provider.
Option 2: settings.json
Merge the following env block into ~/.claude/settings.json; preserve unrelated settings. This is a downloadable international template. Replace the placeholder with your own key, and keep the resulting file private.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
"ANTHROPIC_AUTH_TOKEN": "<MINIMAX_API_KEY>",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "524288",
"CLAUDE_CODE_EFFORT_LEVEL": "low",
"ANTHROPIC_MODEL": "MiniMax-M3.1-Flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M3.1-Flash[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M3.1-Flash[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3.1-Flash[1m]"
}
}For a China-platform key, replace only the base URL with https://api.minimax.cn/anthropic. The model alias mappings keep selections of Sonnet, Opus and Haiku pointed at MiniMax; they do not turn MiniMax into those models.
Official. The [1m] suffix declares the long-context model to the harness. CLAUDE_CODE_AUTO_COMPACT_WINDOW=524288 is MiniMax’s recommended client compaction setting for everyday multi-turn work, not an output-token limit. We did not fill that window in our test.
Thinking depth
Our example deliberately uses low to match the recorded small-task test. MiniMax’s official example uses max. Its current Claude Code guide says that without CLAUDE_CODE_EFFORT_LEVEL, Claude Code uses high; this differs from the API default discussed on the pricing page.
The documented levels are low, medium, high, xhigh and max. While the environment variable is set, MiniMax says /effort cannot change it during the session. Remove that variable if you want to use /effort low interactively. Thinking cannot be disabled for M3.1 Flash.
Verify routing, then reproduce the task
In the Claude Code TUI, use /status to inspect the provider URL and /model to inspect the selected model. These are the verification steps in MiniMax’s guide. A model saying “I use MiniMax” is not routing evidence.
For a repeatable noninteractive check, extract the test kit and set MINIMAX_API_KEY in your environment without putting it in a command transcript. Then run:
python3 run.py claude --region global --output /tmp/claude-result.jsonUse --region cn for a China-platform key. The runner supplies provider settings to that process, uses a temporary Claude configuration directory, limits the available tools, and does not edit your normal settings. It makes real requests and may incur usage charges.
The task checks mixed quantities, an empty invoice, zero quantities, rejection of negative/fractional quantities, and preservation of frozen inputs. Inspect baseline_exit, verification_exit, tests_unchanged, the diff and CLI output. A process exiting successfully alone is not enough. The kit intentionally ships the broken starting function.
Troubleshooting
| Symptom | Evidence and next step |
|---|---|
401 invalid api key | Our testing: the available key failed on .io but worked on .cn. Check region, key validity and key type; do not assume a model-name change fixes authentication. |
| Still routed to another provider | Official: check /status, shell variables and the settings file loaded by this session. |
| Model selection switches away from MiniMax | Official: check all three default model alias mappings and ANTHROPIC_MODEL. |
| Model not found | Check the current ID, region and account access. The error alone does not identify which is wrong. |
/effort appears ineffective | Official: remove CLAUDE_CODE_EFFORT_LEVEL before switching effort in-session. |
| Context compacts sooner than expected | Official: check the suffix and compaction setting; this guide has no long-context reproduction. |
Other routes and remaining limits
MiniMax also documents CC Switch. Ollama lists ollama launch claude --model minimax-m3.1-flash:cloud, which uses Ollama’s service and account rather than the direct route tested here. See OpenCode and agents for route choices.
We do not quote the CLI’s estimated dollar cost as a MiniMax bill: the recorded Claude result marks its cost basis as unknown. Use provider billing records for actual spend. We have not measured latency, throughput or a success rate from this single run.
Next: reproduce the same task with the Codex guide, or review pricing and the FAQ before a longer session.
Sources and version notes
Checked October 23, 2026. We label official claims, third-party measurements, our own testing and community reports separately — see the sources policy for what each label means.