Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

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.

  1. Setup wizard. Run npx -y mmx-cli@latest agent setup and 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.
  2. Edit the settings file. In ~/.claude/settings.json, set the env block to:
    • ANTHROPIC_BASE_URL: https://api.minimax.io/anthropic
    • ANTHROPIC_AUTH_TOKEN: your MiniMax API key
    • CLAUDE_CODE_AUTO_COMPACT_WINDOW: 524288
    • CLAUDE_CODE_EFFORT_LEVEL: max
    • ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, and ANTHROPIC_DEFAULT_HAIKU_MODEL: all set to MiniMax-M3.1-Flash[1m]
    Then run claude and 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.
  3. 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

Limits

Related playbooks

Sources

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