Download

How to use MiniMax in Claude Code and Codex

Tyler J. Cagle5 min read

Auto, the Mac app for all your coding agents, puts MiniMax M3.1 Flash in each one's model picker (Claude Code, Codex, Cursor, etc.) with no MiniMax key or config, next to the AI subscriptions you already pay for. The native route takes a MiniMax key and config in each app. To use MiniMax in Claude Code, set ANTHROPIC_BASE_URL to https://api.minimax.io/anthropic, put your MiniMax M Plan key in ANTHROPIC_AUTH_TOKEN and set the model variables to MiniMax-M3.1-Flash[1m] in ~/.claude/settings.json (MiniMax's Claude Code guide). In Codex, add https://api.minimax.io/v1 as a provider in ~/.codex/config.toml (MiniMax's Codex guide).

Auto wrote this post. The MiniMax routes below bill to your MiniMax account with nothing in between. Every setting is copied from MiniMax's, Anthropic's or OpenAI's docs as checked on November 17, 2026; check the linked page before you paste.

How do you use MiniMax in Claude Code?

Point Claude Code at MiniMax's Anthropic-compatible endpoint and set each model tier to MiniMax-M3.1-Flash. MiniMax offers a setup wizard, npx -y mmx-cli@latest agent setup, or you can edit the file yourself:

  1. Run unset ANTHROPIC_AUTH_TOKEN and unset ANTHROPIC_BASE_URL, so old exports in your shell don't override the file.
  2. Add the block below to ~/.claude/settings.json, with your M Plan API key in place of <MINIMAX_API_KEY>.
  3. Start claude in your project and run /status to check the base URL and model.
{
  "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": "max",
    "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]"
  }
}

MiniMax recommends compacting at 512K tokens, which is what CLAUDE_CODE_AUTO_COMPACT_WINDOW sets, though the model reads up to 1M. Thinking is always on. While CLAUDE_CODE_EFFORT_LEVEL is set, /effort has no effect, so remove that line if you want to change effort during a session. While the token is set, it replaces your claude.ai login, so your Claude plan's limits don't apply (Anthropic docs).

How do you use MiniMax in Codex?

Add MiniMax as a custom provider in ~/.codex/config.toml. Codex speaks only the Responses API (OpenAI config reference), and MiniMax's /v1 endpoint supports it. The same wizard sets Codex up and recommends Codex CLI 0.146.0 or newer; by hand, add:

model = "MiniMax-M3.1-Flash"
model_provider = "minimax"
model_context_window = 524288
preferred_auth_method = "apikey"
forced_login_method = "api"

[model_providers.minimax]
name = "MiniMax"
base_url = "https://api.minimax.io/v1"
experimental_bearer_token = "<MINIMAX_API_KEY>"
wire_api = "responses"

Restart Codex so it reads the change. MiniMax's guide adds an optional model catalog file for reasoning levels and image input, and warns never to send an effort of none, which the API rejects with a 400 error. OpenAI's reference calls experimental_bearer_token discouraged and suggests env_key, which reads the key from an environment variable. Codex model providers and config.toml, explained covers the other provider keys.

What does MiniMax cost?

MiniMax-M3.1-Flash costs $0.15 per million input tokens, $0.015 per million cached input tokens and $0.60 per million output tokens on pay-as-you-go, as of November 17, 2026 (MiniMax pricing). It has a 1M-token context window (MiniMax models).

MiniMax's Claude Code guide uses an M Plan key. The M Plan is MiniMax's coding subscription, in Go, Explore and Build tiers with 1×, 3× and 7.5× Go's quota, and M3.1 Flash is its text model on every tier (MiniMax M Plan). MiniMax retires its M2.5 and M2.7 models on November 18, 2026; the old MiniMax-M3.1-Flash-Preview name already serves M3.1 Flash.

How do you use MiniMax with Auto?

Pick MiniMax M3.1 Flash in the model picker. Auto adds frontier and open-weight models to every coding agent you use, with no keys or endpoints to set up, and MiniMax M3.1 Flash is on Auto's models page as of November 17, 2026. Choosing it sends your requests straight to it. Choosing Auto lets it work out how hard each task is and send each one to the model that fits; every task has to clear a quality bar for its difficulty before price counts.

  1. Download Auto for macOS from autorouter.com.
  2. Open it, sign in or create a free account, sign in to your plans, allow Accessibility, and click Enable for each app.
  3. Start a new session and choose a model: in Codex, from the model menu under the message box; in Claude Code, with /model.

Auto pools the AI subscriptions you already pay for: any of them can run in any of your coding agents, and when one account reaches its limit Auto moves on to the account with the most room left before it spends any credit. MiniMax is a pay-per-use model on Pro, which includes usage each month, billed at the provider's price plus 10%. New accounts get a week of Pro, or until its included usage is spent, whichever comes first.

If MiniMax is all you need, an M Plan or a MiniMax API key is the cheaper, more direct route. Auto runs on macOS 14 or later, and Claude Code needs Node 22.18 or later to use it. Requests pass through Auto's servers; it doesn't store transcripts, but keeps the message that opens each request, up to 4,000 characters, to review routing (Auto privacy).

Which MiniMax setup should you use?

As of November 17, 2026:

RouteSetupKeyWhat pays
Claude Code + MiniMaxWizard, or env block in ~/.claude/settings.jsonM Plan API keyYour M Plan quota
Codex + MiniMaxWizard, or a provider in config.tomlM Plan API keyYour M Plan quota
Auto (Mac)Install, sign in, click EnableNonePro usage at the provider's price plus 10%

For which tasks suit a low-cost model and which need a frontier one, see Which model for which coding task. Try a new model in Codex or Claude Code without another API key covers other providers.

If you already run MiniMax through a separate environment block, try the Claude Code config checker.

Questions

Why doesn't /effort change anything with MiniMax?

Because CLAUDE_CODE_EFFORT_LEVEL is set in the env block, and MiniMax's guide says /effort has no effect while it is. Remove that line to change effort in a session. MiniMax supports low, medium, high, xhigh and max.

Why compact at 512K when MiniMax reads 1M tokens?

MiniMax says its own ProgramBench run scored about the same at 512K as at 1M, at about 20% lower cost, so its guides compact at 524,288 tokens (MiniMax: Codex). Raise CLAUDE_CODE_AUTO_COMPACT_WINDOW or model_context_window if a task needs more of the window.

Does my Claude plan pay for MiniMax in Claude Code?

No. With ANTHROPIC_AUTH_TOKEN set, Claude Code sends your MiniMax key in place of your claude.ai login, so the requests count against your MiniMax account (Anthropic docs). Delete the keys from the env block to go back to your plan.

Sources