MiniMax M3.1 Flash: Claude Code, OpenCode and Cline Setup
Configure MiniMax M3.1 Flash with exact model IDs and provider settings, plan paid access beyond free promotions, and compare vendor pricing without confusing token rates with the cost of a completed coding task.
Contents

For direct MiniMax M3.1 Flash access in Claude Code or OpenCode, use MiniMax’s Anthropic-compatible API and explicitly select MiniMax-M3.1-Flash; changing the base URL alone does not select the model. In Cline, use its native OpenRouter integration and select the model’s current OpenRouter ID. Test one bounded repository task before changing your default: the published token prices make Flash worth evaluating, but they do not establish the cost of a successful fix.
Information below is updated as of 2026-10-22.
What changed from MiniMax M3?
M3.1 Flash is a hosted model you can use now; Space Bunny was its earlier anonymous version. MiniMax’s 2026-10-19 launch announcement confirms that relationship and API availability, while describing model weights as a later release. An earlier Space Bunny session is therefore not a controlled review of the final release.
Both M3 and M3.1 Flash have a 1,000,000-token context window, counting input and output together. The practical differences include lower published token rates and Flash’s mandatory thinking: M3 permits thinking to be disabled, whereas Flash rejects that setting. Flash exposes effort levels from low to max, defaulting to max; higher effort can increase generated reasoning and latency.
Start with Flash for repository exploration, a bounded bug fix, or a test-writing task whose result you can check. If your application requires a non-thinking response mode, M3.1 Flash does not meet that requirement. A million-token context is a capacity limit, not an included usage allowance.
When does free access end?
Choose your continuation route before starting a long session. These are separate provider promotions, not one shared MiniMax free period.
| Route | Published terms checked as of 2026-10-22 | Action when continuing |
|---|---|---|
| OpenRouter | Published free-access end for minimax/minimax-m3.1-flash:free: 2026-10-22 at 12:00 UTC. | OpenRouter’s notice says the free variant retires after that time; use minimax/minimax-m3.1-flash and fund paid usage. |
| Ollama Cloud | Published free-access end: 2026-10-22 at 23:59 UTC; the CLI tag is minimax-m3.1-flash:cloud. | Check the displayed paid rates and your Ollama billing settings. This is a cloud route. |
| OpenCode’s hosted model service | minimax-m3.1-flash-free is listed as temporarily free. The documentation does not specify an exact cutoff. | Check the current model listing, or configure the direct MiniMax provider below. |
OpenRouter’s published free-model limits are 20 requests/minute and 50/day, increasing to 1,000/day after at least $10 in credit purchases. Failed attempts count toward the daily limit. One coding task can require many requests, so a promotional end time does not establish whether enough request quota remains for a long agent session.
Claude Code: set the endpoint, credentials, and model aliases
Use a MiniMax key with the billing type you intend. Create a standard pay-as-you-go key through API Keys → Create new secret key in the MiniMax platform. An M Plan Subscription Key consumes subscription usage and eligible credit packs instead; the two key types have separate billing. The cost calculations later use standard direct API billing.
The example assumes Claude Code is installed and you are in your project directory. Before launching it, remove conflicting provider or credential entries from the applicable ~/.claude/settings.json, project .claude/settings.json, and .claude/settings.local.json. Claude Code’s environment-variable reference says settings-file env values normally replace the same inherited shell variables; exporting a new value is not sufficient when a conflicting setting remains.
In Bash on macOS, Linux, or WSL, run the first line, paste your MiniMax key, and press Enter. Input is hidden.
read -rs MINIMAX_API_KEY && export MINIMAX_API_KEY
unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="$MINIMAX_API_KEY"
export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
export ANTHROPIC_MODEL="MiniMax-M3.1-Flash[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_OPUS_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="$ANTHROPIC_MODEL"
export CLAUDE_CODE_AUTO_COMPACT_WINDOW="524288"
claude --model "$ANTHROPIC_MODEL"
This follows MiniMax’s Claude Code configuration, with the credential supplied through the shell. It sets the main model and the Sonnet, Opus, and Haiku aliases. The token is used for bearer authentication.
The [1m] suffix tells Claude Code the custom model supports a million-token context; Claude Code removes that suffix before sending the API request. Keep the bare ID MiniMax-M3.1-Flash in other clients. The 524288 setting is MiniMax’s recommended automatic-compaction window, not a smaller model specification.
Inside Claude Code, run:
/status
/model
Confirm the MiniMax endpoint and active M3.1 Flash model. Then, in a repository containing README.md, send:
Read README.md and summarize the project's purpose in one paragraph. Do not edit files or run commands.
Look for the file-read action and an answer grounded in that file. Ask a follow-up about a specific README section to exercise conversation history as well. A model picker entry alone only verifies selection.
If authentication fails with 401, check the key’s account and service region, then check for conflicting credentials in settings before retrying. If /status still shows another endpoint, resolve that configuration conflict and start a new session.
OpenCode: configure a direct MiniMax provider
Create a custom provider for your pay-as-you-go key using MiniMax’s documented Anthropic adapter. Merge this configuration into ~/.config/opencode/opencode.json; preserve any other settings you need.
{
"$schema": "https://opencode.ai/config.json",
"model": "minimax-direct/MiniMax-M3.1-Flash",
"provider": {
"minimax-direct": {
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://api.minimax.io/anthropic/v1",
"apiKey": "{env:MINIMAX_API_KEY}"
},
"models": {
"MiniMax-M3.1-Flash": {
"name": "MiniMax-M3.1-Flash",
"limit": {
"context": 524288
}
}
}
}
}
}
The extra /v1 is intentional. MiniMax’s OpenCode instructions explain that @ai-sdk/anthropic appends /messages to its base URL. Claude Code uses https://api.minimax.io/anthropic; this adapter uses https://api.minimax.io/anthropic/v1.
OpenCode supports custom provider options and substitutes {env:MINIMAX_API_KEY} from the launching environment. If you opened a new Bash terminal, collect the key again, then start the model:
read -rs MINIMAX_API_KEY && export MINIMAX_API_KEY
opencode --model minimax-direct/MiniMax-M3.1-Flash
Use /models to confirm the provider/model, then repeat the README read and follow-up check. Results appear in the terminal session.
If authentication fails, confirm the variable was set in the terminal that launched OpenCode. If the wrong provider remains active, inspect the project’s opencode.json, which can override global configuration. A request-path error warrants checking the adapter and its /anthropic/v1 base together.
Cline: use the native OpenRouter connection
Connect Cline with an OpenRouter key and select OpenRouter’s model identifier. Its official setup guide documents this provider-specific path:
- Open Cline’s settings using the gear icon.
- Choose OpenRouter under API Provider.
- Enter your OpenRouter API key in OpenRouter API Key.
- For ongoing paid use, select
minimax/minimax-m3.1-flash. The published end time for the promotionalminimax/minimax-m3.1-flash:freeID is 2026-10-22 at 12:00 UTC. - Leave the custom base URL unset, start a fresh chat, and repeat the README read and follow-up check.
Read the model’s response and file action in Cline’s task panel. This route bills through OpenRouter. Its Standard plan adds 5.5% when you buy credits, rather than charging that fee on each request; applicable taxes are additional.
For a 429, check the free-model request allowance before retrying. After the free ID retires, adding credits alone does not change the model selection: select the base ID. OpenRouter documents a deprecated model’s 404 response as potentially containing no endpoints for this model found.
BetterToken: an option for one key across model vendors
Choose BetterToken when you want pay-as-you-go access to several model vendors through one key. Its model catalog lists MiniMax-M3.1-Flash with OpenAI Chat Completions, Anthropic Messages, and Responses endpoint support. MiniMax direct remains an option for direct vendor billing, while OpenRouter provides the native Cline connection described above.
Create a BetterToken account, then create your own API key in the console. Check current BetterToken prices and your account’s applicable rates; the direct-vendor cost table below does not represent BetterToken charges.
For Claude Code, use the documented Anthropic-compatible base URL, https://bettertoken.ai, without /v1. Before switching, remove conflicting provider, credential, and model entries from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json. Settings-file env values can override the shell.
In Bash on macOS, Linux, or WSL, run the first line, paste your BetterToken key, and press Enter; input is hidden. Then run the remaining commands:
read -rs BETTERTOKEN_API_KEY && export BETTERTOKEN_API_KEY
unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="$BETTERTOKEN_API_KEY"
export ANTHROPIC_BASE_URL="https://bettertoken.ai"
export ANTHROPIC_MODEL="MiniMax-M3.1-Flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_OPUS_MODEL="$ANTHROPIC_MODEL"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="$ANTHROPIC_MODEL"
claude --model "$ANTHROPIC_MODEL"
Use /status and /model to confirm the BetterToken endpoint and selected model, then repeat the README read and follow-up check. For a 401, check that the key belongs to your BetterToken account and that no settings entry overrides it. If the endpoint is wrong, resolve the conflict and start a new session.
- OpenCode: Follow the custom provider instructions. In
~/.config/opencode/opencode.json, add providerbettertokenwithnpmset to@ai-sdk/openai-compatible,options.baseURLset tohttps://www.bettertoken.ai/v1, andMiniMax-M3.1-Flashregistered undermodels. Run/connect, choose Other, enter provider IDbettertoken, and save your BetterToken key. Start withopencode --model bettertoken/MiniMax-M3.1-Flash. - Cline: Follow the OpenAI Compatible setup. In settings, choose OpenAI Compatible under API Provider, set Base URL to
https://www.bettertoken.ai/v1, enter your BetterToken API key, and set Model toMiniMax-M3.1-Flash. Save and reload Cline.
For both clients, start a fresh session and repeat the README read and follow-up check before a long task. This is API access; third-party tool accounts and subscriptions remain separate.
For readers in Russia, reaching BetterToken’s API endpoint does not require a VPN, and BetterToken supports ruble payments. This scope does not cover third-party websites, downloads, logins, marketplaces, or updates. Check the console for available payment channels, eligible cards, minimum amounts, exchange rates, fees, and settlement times.
How should you read the official benchmarks?
Use the benchmark table to select tasks for your evaluation, not to assume Flash will outperform your existing model. These four relevant rows come from MiniMax’s published comparison:
| Vendor-reported benchmark | MiniMax M3.1 Flash | DeepSeek-V4.1-Flash-1017 |
|---|---|---|
| Automation-Bench v1.0.6 | 62.8 | 60.5 |
| Terminal Bench 4.0 | 38.1 | 42.3 |
| DeepSWE v1.1 | 73.7 | 77.0 |
| NL2Repo-Bench | 61.2 | 68.2 |
MiniMax leads the automation row; DeepSeek leads these three terminal/coding rows. The chart’s DeepSWE result uses mini-SWE-agent 2.4.5 with a 512K context limit, while NL2Repo uses Claude Code 2.1.233 with 512K. Those results are tied to their evaluation setups.
MiniMax also advertises nearly threefold online inference speed and 70% lower agent-task costs. Treat these as vendor claims, not a promise that your repository fix finishes three times faster or costs 70% less. The release chart does not include an M3 column from which to calculate an M3 benchmark delta.
Compare paid token charges before comparing task cost
Compare identical billed-token quantities first, then measure what each model actually consumes to finish your task. As of 2026-10-22, the MiniMax tariff and DeepSeek tariff list these direct API rates, in USD per 1 million tokens:
| Direct API tariff | Uncached input | Cached input | Output |
|---|---|---|---|
MiniMax-M3.1-Flash | $0.15 | $0.015 | $0.60 |
deepseek-flash, peak | $0.30 | $0.006 | $1.20 |
deepseek-flash, off-peak | $0.15 | $0.003 | $0.60 |
DeepSeek currently maps deepseek-flash to DeepSeek-V4.1-Flash-1017. Peak hours are 01:00–04:00 and 06:00–10:00 UTC, Monday–Friday, excluding Chinese public holidays; all other periods are off-peak.
For comparison with M3, MiniMax currently lists M3’s standard rates at $0.30 input, $1.20 output, and $0.06 cached input for requests with ≤ 512k input tokens. Flash’s ordinary input/output rates are half those M3 rates. The launch’s aggregate task-cost claim should not be used as a universal token-price multiplier.
Let u, c, and o be uncached input, cached input, and output, measured in millions of billed tokens:
MiniMax = 0.15*u + 0.015*c + 0.60*o
DeepSeek peak = 0.30*u + 0.006*c + 1.20*o
DeepSeek off-peak = 0.15*u + 0.003*c + 0.60*o
The following are estimates of token charges, not executed task results. They assume direct pay-as-you-go APIs, text requests, no provider-hosted paid tools, and output counts including billed reasoning. They exclude account-specific taxes and payment charges; they are not BetterToken, OpenRouter, or subscription invoices.
| Assumed billed workload | MiniMax | DeepSeek peak | DeepSeek off-peak |
|---|---|---|---|
| 100,000 uncached input + 20,000 output | $0.02700 | $0.05400 | $0.02700 |
| 10,000 uncached input + 90,000 cache-hit input + 20,000 output | $0.01485 | $0.02754 | $0.01377 |
For the second row, MiniMax’s calculation is 0.01 × $0.15 + 0.09 × $0.015 + 0.02 × $0.60 = $0.01485. The assumed cache hits are not a predicted hit rate. Initial cache-building requests and any retries must also be included when costing a complete task.
MiniMax caching is automatic, applies from 512 input tokens, and bills new input at the normal rate and actual hits at the cached rate. DeepSeek caching also works automatically, but reuse must match a complete persisted prefix unit; hits are not guaranteed.
For MiniMax’s Anthropic-compatible responses, input_tokens represents new input and cache_read_input_tokens represents hits. In its OpenAI-compatible responses, cached tokens are a subset of prompt_tokens. Keep those accounting conventions separate.
The first scenario gives Flash lower token charges than DeepSeek’s peak tariff and equal charges off-peak. The second gives DeepSeek the lower off-peak estimate. Neither calculation establishes a winner per completed fix.
Run one acceptance task before switching your default
Make the first evaluation small enough that you can verify the patch and its bill. Use two clean copies of the same commit, one task description, the same client version, repository instructions, tool access, and acceptance test. Start separate conversations so one model does not inherit the other’s investigation.
Record the selected model, provider, reasoning settings, start time, elapsed time, cache hits, uncached input, output, retries, and total charge. Include every attempt required to get the accepted result, plus any paid tools or intermediary fees. Passing the same acceptance test is the minimum condition for comparing the two costs.
Pay particular attention to reasoning configuration. MiniMax Flash cannot disable thinking; a 400 containing requires adaptive thinking calls for removing the disabled/none setting, then retrying the small check. Its API documentation maps effort to output_config.effort for Anthropic-compatible requests and reasoning_effort for OpenAI-compatible requests. Identical effort labels across vendors do not imply identical computation.
Evaluate Flash first for your bounded coding task when uncached input/output charges during DeepSeek’s peak hours dominate. Keep DeepSeek in the comparison when work can run off-peak or repeatedly reuses cached context. Reverse the provisional choice if the other model produces accepted changes with fewer retries, lower total charges, or materially better completion time.