Run MiniMax M3.1 Flash Inside Claude Code: Setup and Costs MiniMax published a Claude Code setup guide on October 19, 2026 that points Anthropic's coding harness at MiniMax's Anthropic-compatible endpoint to run the newly released MiniMax-M3.1-Flash model, priced at $0.15 per million input tokens and $0.60 per million output on pay-as-you-go, or via an M Plan billed annually from $220 a year. The switch requires setting the base URL to https://api.minimax.io/anthropic with a Subscription Key and the model name MiniMax-M3.1-Flash[1m], and MiniMax recommends CLAUDE_CODE_AUTO_COMPACT_WINDOW=524288 so Claude Code compacts long sessions at 524,288 tokens rather than the full 1M context. MiniMax's guide says /status should show the MiniMax base URL and /model should show MiniMax-M3.1-Flash, warning that if either still says Claude the user is still paying Anthropic; DeepSeek documents an equivalent setup, with its web search through Claude Code starting to bill at 16:00 UTC on October 31. Claude Code sends its requests in Anthropic's API format, and it can send them to a different address. MiniMax runs an Anthropic-compatible endpoint and publishes a Claude Code setup guide https://platform.minimax.io/docs/m-plan/claude-code that points it at M3.1 Flash, the model MiniMax released on October 19, 2026. You keep Claude Code's file editing, terminal tools, slash commands and subagents, and the model doing the work becomes MiniMax's, at $0.15 per million input tokens and $0.60 per million output on pay-as-you-go. We have covered this pattern before with GLM-5.2 inside Claude Code https://www.digitalapplied.com/blog/run-glm-5-2-inside-claude-code-setup-guide . What is different here is the model: a brand-new, cheap model with image and video input and a one-million-token context, which we cover in our M3.1 Flash release post https://www.digitalapplied.com/blog/minimax-m3-1-flash-price-benchmarks-release . Everything below comes from MiniMax's and DeepSeek's own setup documentation, read on October 19. Settings files change between releases, so treat the vendor's page as the source for exact key names. 1. 01One base URL changes the model.Pointing Claude Code at https://api.minimax.io/anthropic with your Subscription Key, and setting the model names to MiniMax-M3.1-Flash 1m in the settings file or MiniMax-M3.1-Flash with Declare 1M in CC Switch , does the switch. MiniMax offers a wizard, a settings file and a provider tool to do it. 2. 02Set the 512K compaction window.MiniMax recommends CLAUDE CODE AUTO COMPACT WINDOW=524288, so Claude Code compacts long sessions at 524,288 tokens 512K rather than running to the full 1M window. 3. 03Check with /status and /model.MiniMax's guide says /status should show the MiniMax base URL and /model should show MiniMax-M3.1-Flash. If either still says Claude, you are still paying Anthropic. 4. 04Subscription or metered.M Plan, billed annually from $220 a year, includes M3.1 Flash with 5-hour and weekly usage windows. Pay-as-you-go is $0.15 input and $0.60 output per million tokens. 5. 05DeepSeek works the same way.DeepSeek documents an equivalent setup and maps Claude model names to its own models. Its web search through Claude Code starts billing at 16:00 UTC on October 31. 01 — WhyWhy run it inside Claude Code . A coding agent is two things: the harness, which reads files, runs commands, manages context and asks for permission, and the model that decides what to do. Claude Code is a harness many teams already know well, with their own CLAUDE.md files, skills, hooks and habits built around it. Swapping the model behind it keeps all of that and changes the bill. The use case is cost on volume. Background tasks, test writing, refactors across many files and long exploratory sessions burn tokens fast. Running those on a model at $0.15 and $0.60 per million, while keeping a Claude model for the hardest work, is a reasonable split. OpenRouter's public usage page for M3.1 Flash's free route listed Claude Code among the apps sending it the most traffic on launch day, so the pattern is already in use. The failure case is expecting the same results. The harness stays the same; the judgement inside it does not. A cheaper model may take more steps, misread a tool result or stop early on work a Claude model would finish. Treat the switch as a trial on real tasks, not a drop-in replacement. 02 — SetupThree ways to set it up . MiniMax's guide offers three routes. All three end with Claude Code sending requests to MiniMax's Anthropic-compatible endpoint with an M Plan subscription key. Setup wizard Run npx -y mmx-cli@latest agent setup and select Claude Code. It runs Claude Code's official installer if needed, checks the installed version, updates ~/.claude/settings.json and adds MiniMax's model list. Fastest for a single machine. Edit the settings file Clear any exported ANTHROPIC AUTH TOKEN and ANTHROPIC BASE URL, add MiniMax's base URL, your Subscription Key, the model names and the compaction window to Claude Code's user settings, then run claude and select Trust This Folder. Best when you want every value visible in one file; keep the key out of version control. CC Switch Add the MiniMax preset with your key, set all model names to MiniMax-M3.1-Flash, select Declare 1M, add the compaction setting and enable. Best when you switch between providers often. The example that suits most teams: use the wizard on one machine to see a working configuration, then copy the resulting settings, minus the key, into your team's managed settings so everyone runs the same configuration with their own key; MiniMax's FAQ says not to share a Subscription Key and describes the M Plan as built for individual use. The failure case is three developers each configuring it differently and comparing results from three different setups. 03 — SettingsThe settings that matter . Whichever route you take, four values do the work. First, clear any ANTHROPIC AUTH TOKEN and ANTHROPIC BASE URL already exported in your shell: MiniMax's guide says they take priority over the settings file and tells you to remove them from ~/.bashrc or ~/.zshrc too. Its manual example for ~/.claude/settings.json follows, with your Subscription Key in place of the placeholder; the table explains what each value changes. unset ANTHROPIC AUTH TOKEN unset ANTHROPIC BASE URL { "env": { "ANTHROPIC BASE URL": "https://api.minimax.io/anthropic", "ANTHROPIC AUTH TOKEN": "