MiniMax M3.1 Flash in Claude Code: free till Thursday, plus the undo steps
The short version
MiniMax released M3.1 Flash on 19 Oct 2026. It writes code for 60 cents per million output tokens, and Vercel made it free on its AI Gateway until Thursday, 22 Oct (Vercel gives no cutoff time). One Vercel command points Claude Code at the gateway, then you pick MiniMax in /model. Opus 5.5 charges 20 dollars for the same million tokens, so sending every small fix to Opus this week is basically burning money.
Two catches. The 73.7 on DeepSWE is MiniMax's own number, so run one real task before you trust it. And the setup moves Claude Code to API-key billing: switch back to Opus inside Claude Code and that call is billed per token through the gateway, not covered by your Claude plan. Preview the setup with --dry-run, put a budget on the key, and keep the undo steps below.
| Number | What it means |
|---|---|
| 0.60 USD | M3.1 Flash, per million output tokens (0.15 in, 0.015 cached in) |
| 0 USD | on Vercel AI Gateway until Thu 22 Oct, when MiniMax serves the request |
| 20 USD | Opus 5.5, per million output tokens |
| 73.7% | DeepSWE v1.1, MiniMax's own table (long, real coding jobs) |
| 1M | tokens of context on the gateway |
| 1 command | npx vercel ai-gateway setup, then /model |
Sources: MiniMax blog, 19 Oct 2026 · Vercel changelog, 19 Oct 2026 · Vercel docs: Claude Code with AI Gateway · Anthropic pricing (all read 20 Oct 2026)
Copy these prompts
Do the setup below first. Prompt 1 runs on your normal model before you switch, prompt 2 runs on MiniMax M3.1 Flash, prompt 3 runs back on your normal model.
1. Pick one real task and freeze the starting point
I want to test a cheaper coding model on one real task in this repo before I trust it. Suggest three small
tasks from the open issues, TODOs or recent bugs, each with a clear definition of done (a test that should
pass, or a behaviour I can check by hand). For the one I pick, write the exact prompt I will give the model,
word for word, and save it to compare/task.md. Then create a branch called compare/base from the current
commit. Don't change any code yet.
2. Run it on MiniMax M3.1 Flash
Read compare/task.md and do exactly what it says. Work on a new branch called compare/minimax, created from
compare/base. When you are done, run the tests, then write compare/minimax.md with: the files you changed,
whether the tests pass, anything you were unsure about, and every time you had to guess.
3. Judge the diff, then decide
Review the branch compare/minimax against compare/base. Report: do the tests pass, did it change any file the
task did not need, did it remove or weaken any test, and what would I have to fix before merging. End with one
line: for this kind of small task, is this model good enough to use instead of Opus, yes or no, and why.
The exact setup
From Vercel's changelog and docs. Preview first, then set it up for Claude Code only:
# 1. see what it would change, nothing is written
npx vercel@latest ai-gateway setup --agent claude-code --dry-run
# 2. set up Claude Code only
npx vercel@latest ai-gateway setup --agent claude-code
Then open a new terminal, run claude, type /model and pick MiniMax M3.1 Flash (minimax/minimax-m3.1-flash).
What the command does:
- Creates an AI Gateway API key and writes
~/.claude/settings.json:ANTHROPIC_BASE_URL=https://ai-gateway.vercel.sh/claude-code, an emptyANTHROPIC_API_KEY, gateway model discovery on. - On macOS, stores the key in the Keychain and exports
ANTHROPIC_AUTH_TOKENfrom your shell startup file. - Saves a
.bakcopy of every file it changes. - Run bare (
npx vercel ai-gateway setup), it configures every supported coding agent it finds: Claude Code, Codex, Cursor and more. That's why the commands above pass--agent claude-code.
Last step: in the Vercel dashboard, set a budget on the gateway key, so a model switch can't run up a bill.
The trap: your Claude plan is out of the loop
Vercel's docs say it plainly: "The Vercel CLI setup command configures API-key authentication only." The subscription flow needs ANTHROPIC_CUSTOM_HEADERS, which the setup command does not write.
| After the setup | Billed how |
|---|---|
| MiniMax M3.1 Flash, until Thu 22 Oct | free, when MiniMax serves it |
| MiniMax M3.1 Flash, after the offer | MiniMax's standard 0.15 / 0.60 USD per million |
| Opus 5.5, picked in the same Claude Code | per token at Anthropic's API price (20 USD per million out), not your Claude plan |
Check which model is active before a long session, and keep the budget on the key.
The undo steps
- Restore Claude Code's settings from the backup the command made:
mv ~/.claude/settings.json.bak ~/.claude/settings.json
If you had no settings file before, delete the ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY and CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY entries from its env block instead.
- Remove the
ANTHROPIC_AUTH_TOKENexport the setup added to~/.zshrcor~/.bashrc, or restore that file's.bak. - Open a new terminal, run
claude, then/loginwith your Claude account. - If you ran the bare command, repeat for each agent it listed (Codex, Cursor and so on). Each changed file has a
.bak.
The catch
- 73.7 is MiniMax's own number. The company grades its own model. One real task on your repo tells you more.
- Free has a deadline. Thursday 22 Oct, no time given. After that, pinned requests bill at MiniMax's standard rate.
- The setup rewires agents. Run bare, it touches every supported agent on your machine. Use
--agent claude-code. - Opus stops using your plan. Anything you run on Opus inside that Claude Code is billed per token until you undo.
- Weights aren't out yet. MiniMax says they come later.
If you are building on it
- AI SDK:
model: 'minimax/minimax-m3.1-flash'through AI Gateway. Chat Completions: base URLhttps://ai-gateway.vercel.sh/v1. - To keep the free rate, pin MiniMax as the provider with
orderin the gateway provider options. After Oct 22 those pinned requests bill at 0.15 / 0.60 USD per million tokens. - Route by job size: small fixes, tests and docs to the cheap model, long multi-step work to your best one. Log task, model, pass or fail and cost for a week.
- After Thursday you can call MiniMax's own API directly; MiniMax documents a Claude Code setup on its platform docs.
Run this on your codebase
Look at the last 20 tasks I gave you in this repo (use git log and the commit messages). Sort them into small
jobs (renames, lint fixes, tests, docs, one-file bugs) and big jobs (multi-file features, migrations, long
debugging). Count each group. Then tell me which small jobs I could have sent to a cheap model, and write the
exact prompt for one of them so I can test it this week.