---
title: "Claude Code + MiniMax: M3.1 Flash setup, limits and where your code goes — Aventail™ Guides"
url: https://aventail.co.uk/guides/claude-code-minimax
description: "Run Claude Code on MiniMax M3.1 Flash: the base URL and settings from MiniMax's docs, M Plan, what breaks, where prompts are stored and the self-hosted path."
lang: en-GB
---

Skip to content

Aventail™ co-founder speaks to BBC Radio Wales on AI safety and AI agents. Read the story: https://aventail.co.uk/newsroom/bbc-radio-wales-joseph-ward-ai-agents-safety

All guides (https://aventail.co.uk/guides)

# Claude Code + MiniMax: M3.1 Flash setup, limits and where your code goes

23 November 2026 13 min read

Run Claude Code on MiniMax M3.1 Flash: the base URL and settings from MiniMax's docs, M Plan, what breaks, where prompts are stored and the self-hosted path.

Claude Code runs on MiniMax's models through MiniMax's Anthropic-compatible endpoint at `https://api.minimax.io/anthropic`. Put that base URL, a MiniMax API key and the model name `MiniMax-M3.1-Flash[1m]` in the `env` block of `~/.claude/settings.json`, and Claude Code sends every model request to MiniMax.

As of 15 November 2026 the endpoint serves two models, MiniMax-M3.1-Flash and MiniMax-M3, both with a 1M-token context window. The international platform is run by Nanonoble Pte. Ltd. in Singapore, and its privacy policy says data is stored in a data centre in the United States. This guide gives the setup from MiniMax's own docs, how to check which model answered, what does not work, what the terms say about your prompts, the self-hosted path with the open weights, and the same setup for a team.

## What you need

| | Value on 15 November 2026 |
| --- | --- |
| Claude Code | Any current version. MiniMax points to Anthropic's setup page |
| MiniMax account | An M Plan API key from the MiniMax console, or a pay-as-you-go key with balance |
| Base URL | `https://api.minimax.io/anthropic` |
| Models on this endpoint | `MiniMax-M3.1-Flash` and `MiniMax-M3` only |
| Context | 1M tokens. MiniMax recommends a 512K auto-compaction window in Claude Code |
| M Plan | A subscription for individuals with three tiers: Go, Explore at 3 times Go's usage, Build at 7.5 times. M3.1 Flash is the text model on all three |
| M Plan price | Go $220 a year, Explore $550, Build $1,320, as listed for annual billing |
| Pay-as-you-go price per 1M tokens | MiniMax-M3.1-Flash: input $0.15, output $0.60, cached read $0.015. MiniMax-M3: $0.30 and $1.20 up to 512K input tokens |
| Anthropic account | Not needed for model requests |

MiniMax-M3.1-Flash-Preview has been retired; requests with the old name are served by MiniMax-M3.1-Flash. Guides that set `MiniMax-M2`, `MiniMax-M2.5` or `MiniMax-M2.7` predate the current docs, which list only the two M3 names for this endpoint.

## Step 1: install Claude Code

macOS, Linux and WSL:

`curl -fsSL https://claude.ai/install.sh | bash`

Windows PowerShell:

`irm https://claude.ai/install.ps1 | iex`

You can skip this if you use MiniMax's setup wizard in step 3. It offers to run the official installer when it cannot find the `claude` command.

## Step 2: clear old variables and get a key

MiniMax's guide starts with a warning to clear two variables from the shell:

`unset ANTHROPIC_AUTH_TOKEN`
`unset ANTHROPIC_BASE_URL`

If `~/.bashrc` or `~/.zshrc` exports them, remove those lines too, or new shells load them again. Anthropic's docs say a value in the settings file replaces the shell value in most sessions. Clearing stale exports removes the doubt.

Then get the key. For the subscription, copy the M Plan API key from the plan page in the MiniMax console. For pay-as-you-go, create an API key and add balance.

## Step 3: configure Claude Code

MiniMax gives three ways. Use one.

**The setup wizard.** Select Claude Code when it asks. It checks `claude --version`, updates `~/.claude/settings.json` and adds the MiniMax model list:

`npx -y mmx-cli@latest agent setup`

**The settings file.** Edit or create `~/.claude/settings.json` and replace `<MINIMAX_API_KEY>`:

`{`
`"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]"`
`}`
`}`

**CC Switch.** A third-party tool that switches Claude Code between providers. MiniMax documents a preset for it. Set every model name to `MiniMax-M3.1-Flash`, select Declare 1M, and add the same compaction and effort entries.

What the lines do:

- `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` send model requests to MiniMax with the key as a bearer token.
- `ANTHROPIC_MODEL` and the three alias variables put M3.1 Flash on every tier, including the Haiku alias that runs Claude Code's background tasks. The `[1m]` suffix tells Claude Code the model has a 1M-token window.
- `CLAUDE_CODE_AUTO_COMPACT_WINDOW=524288` makes Claude Code compact the conversation at 512K tokens, the window MiniMax recommends.
- `CLAUDE_CODE_EFFORT_LEVEL=max` sets the default reasoning effort.

The file holds the key in plain text. Do not commit it.

## Step 4: start Claude Code

`cd /path/to/my-project`
`claude`

Select Trust This Folder to start.

## Step 5: set the reasoning effort

Thinking is always on for MiniMax-M3.1-Flash and cannot be disabled. Effort controls how deep it goes: `low`, `medium`, `high`, `xhigh` or `max`. Higher effort can increase response time and usage.

- The default comes from `CLAUDE_CODE_EFFORT_LEVEL`. When it is not set, Claude Code uses `high`.
- While that variable is set, `/effort` in a session has no effect. Remove the variable if you want to switch during a session with `/effort low` or start one with `claude --effort low`.
- Some Claude Code versions send `xhigh` as `high`. Use `max` for the deepest thinking.
- `MAX_THINKING_TOKENS=0` and `"alwaysThinkingEnabled": false` have no effect on M3.1 Flash. The model still thinks.

## Step 6: check which model answered

Inside Claude Code, run:

`/status`
`/model`

`/status` should show `ANTHROPIC_BASE_URL` pointing to `api.minimax.io/anthropic`. `/model` should show the active model as `MiniMax-M3.1-Flash`.

To test the key and endpoint outside Claude Code, this is MiniMax's own request:

`curl https://api.minimax.io/anthropic/v1/messages \`
`-H "Authorization: Bearer <MINIMAX_API_KEY>" \`
`-H "Content-Type: application/json" \`
`-d '{`
`"model": "MiniMax-M3.1-Flash",`
`"max_tokens": 2048,`
`"output_config": { "effort": "max" },`
`"messages": [{ "role": "user", "content": "Hi, how are you?" }]`
`}'`

Thinking tokens count toward `max_tokens`, so a very small value returns `stop_reason: "max_tokens"` with no text.

To go back to Anthropic, remove the `env` entries, open a new terminal and sign in again.

## What works and what does not on MiniMax

Works: chat, reading and editing files, running commands, the agent loop, tool use, streaming, thinking, and image and video input. MiniMax's Anthropic interface also supports the token-count endpoint, `POST /anthropic/v1/messages/count_tokens`.

Does not work, or works differently:

- **Anthropic does not support it.** Anthropic's documentation says it "doesn't support routing Claude Code to non-Claude models through any gateway".
- **Only two models.** MiniMax's docs say the Anthropic interface currently supports only MiniMax-M3.1-Flash and MiniMax-M3.
- **Thinking cannot be turned off on M3.1 Flash.** A request that sends `thinking` as disabled returns a 400 error.
- **Tool choice is limited.** Only `auto` is supported. `none` returns a 400 error.
- **Several parameters are ignored:** `temperature`, `top_p`, `top_k`, `stop_sequences`, `mcp_servers`, `context_management` and `container`. The models always run at temperature 1 and top_p 0.95.
- **Web search is an MCP server.** MiniMax's M Plan MCP provides `web_search` and `understand_image` tools, which you add to Claude Code separately.
- **Plan limits.** M Plan usage is capped per 5 hours and per week, and the tiers differ only in how much they allow.
- **Claude.ai features are off.** Connectors from claude.ai need a claude.ai login, and Remote Control is disabled whenever `ANTHROPIC_BASE_URL` points at a host other than `api.anthropic.com`.

## Where MiniMax hosts the API and what it does with prompts

These are the statements in MiniMax's own documents, read on 15 November 2026. There are two platforms.

| Question | International platform (`api.minimax.io`) | China platform (`api.minimax.cn`) |
| --- | --- | --- |
| Who operates it | Nanonoble Pte. Ltd., 152 Beach Road, Singapore | Shanghai Xiyu Jizhi Technology Co., Ltd. |
| Where data is stored | "Stored in the data center located in the United States" | Personal information collected in China is stored in the People's Republic of China |
| Governing law | Singapore, with arbitration at the Singapore International Arbitration Centre | Not read for this guide |
| Policy date | Privacy Policy and Terms of Service, 30 March 2026 | Privacy policy effective 13 November 2026 |

For the international platform:

- **What is collected.** "We process your Input (which may include text, voice, or other content) and Output and any other information you provide in connection with your use of the Service."
- **Use of inputs.** The Terms of Service say: "We may use the input and generated content to provide, maintain, develop, and improve our Services, comply with applicable law, enforce our terms and policies, and keep our Services safe." They add that MiniMax's use of Confidential Information "for the purpose of improving algorithms or enhancing services does not constitute a breach of confidentiality obligations".
- **A stated limit.** The privacy policy says MiniMax does "not use your input personal data to infer characteristics about an individual, nor use personal data for training to profile or target consumers".
- **Retention.** "For as long as it is necessary or permitted by law or to fulfil the purpose for which it was collected."
- **Transfers.** The policy says data is stored "cross-border in Cloud's US data center" and may be transferred to countries outside your own.
- **Disclosure to authorities.** "When required by law, legal proceedings, litigation or government authorities", with MiniMax requiring "corresponding legal documents, such as subpoenas or letters of inquiry".

The documents do not publish an opt-out from service improvement for API customers, a zero-retention option or a fixed deletion period for inputs. The M Plan is described as a subscription for individuals, and the M Plan pages we read do not describe a team plan with admin controls.

## The alternative: MiniMax's open weights on your own hardware

MiniMax publishes open weights and its own self-hosting guides. Its docs put the boundary plainly: "Self-hosting keeps model weights, input data, and the inference service on infrastructure that you control." The figures below were read on 15 November 2026.

| Model | Size on disk | MiniMax's reference hardware | Status |
| --- | --- | --- | --- |
| MiniMax-M3.1-Flash | About 252 GB. About 428B parameters, 23B active | 4 × NVIDIA B300, single node, SGLang | Experimental |
| MiniMax-M3 | 854 GB at BF16 | 8 × NVIDIA B200, MXFP8 | Experimental |
| MiniMax-M2.7 | 230 GB | 4 high-memory NVIDIA GPUs. No minimum GPU memory is published | Preview |
| MiniMax-M3.1-Flash GGUF (`unsloth`, community build) | 129 GB to 249 GB by quantisation | Outside MiniMax's validated scope | Not a MiniMax release |

Four points from MiniMax's M3.1 Flash guide matter for planning:

- The complete weights must be loaded. "23B activated parameters" does not mean the deployment only needs memory for 23B parameters.
- MiniMax does not publish a minimum host memory or a peak GPU memory figure. SGLang lists 288 GB per GPU for the B300.
- On eight NVIDIA H200 GPUs the context is capped at 140,000 tokens.
- The reference recipe serves an OpenAI-compatible Chat Completions API. Claude Code speaks Anthropic's Messages format, so it needs a gateway in front that exposes that format.

The licence is the MiniMax Community License. It grants free use for non-commercial purposes. Commercial use requires a "Built with MiniMax M3.1-Flash" notice and a one-time notice to MiniMax, and prior written authorisation for products that generate more than $20 million in yearly revenue.

The Ollama library lists `minimax-m3.1-flash` and `minimax-m3` as `:cloud` models that run on Ollama's servers. Neither has a downloadable tag. No MiniMax model fits a laptop or a single workstation GPU. For a model that runs on a developer machine, see our guide to Claude Code with Ollama (https://aventail.co.uk/guides/claude-code-ollama).

## The same models for a team with Aventail ™ Connect

The steps above put a MiniMax key in each developer's settings file. A security lead has no record of which machine sent which request where, and a developer can edit the file.

Aventail ™ Connect configures Claude Code to send its model requests through Aventail ™ Link, the inference engine and gateway that runs on each machine. Routing rules are set in Aventail ™ Control and evaluated on the device. For open weights, the docs support this much:

1. **Serve a model where it fits.** Link runs GGUF language models on the device. A larger model can sit on one internal server running Link and be named in a rule as a network peer. The peer must offer the exact model and have Serve other devices enabled. Peer routing is in beta.
2. **Connect Claude Code.** In Link, open Connected apps and choose Connect next to Claude. There is no endpoint or key to enter. Claude Code needs at least 64K context.
3. **Write the rule.** Permit only On device, or only the peer. If that destination is unavailable, the request fails with an error and is not sent elsewhere.
4. **Check the record.** Send a harmless prompt and confirm the destination in Requests in Control.

MiniMax's weights are far larger than any model in Aventail ™ 's published walkthroughs, and MiniMax ships no GGUF build. Models this size need server hardware. Hardware and model scope for Aventail ™ Link Server is agreed with Aventail ™ 's team, so talk to them before you plan around MiniMax. Free covers three connected devices. Starter is £50 a month excluding VAT with ten devices included. Routing policies need Control for Enterprise.

## Which path to take

| | MiniMax API by hand | MiniMax weights on your own servers | Open weights with Aventail ™ Connect |
| --- | --- | --- | --- |
| Who it suits | One developer, non-sensitive code | An organisation with GPU servers and staff to run them | A team whose code must stay on approved machines |
| Setup | A settings file per developer, or the wizard | SGLang, a Messages-format gateway, then a base URL per developer | Connect button in Link, rules in Control |
| Where prompts are processed | MiniMax's servers; data stored in the United States | Your hardware | Where the routing rule says, evaluated on the device |
| Terms that cover your prompts | MiniMax's, under Singapore law | Your own, plus the model licence | Your own, plus the model licence |
| Record of requests | None on your side | Whatever your server logs | Requests view in Control |
| If the endpoint is down | Requests fail | Requests fail | Fails closed, or falls back to an approved destination |
| Cost | From $220 a year, or $0.15 per 1M input tokens | Hardware and power | Free for three devices; £50 a month for ten |

## Frequently asked questions

**Can I use MiniMax in Claude Code?**
Yes. MiniMax runs an Anthropic-compatible endpoint at `https://api.minimax.io/anthropic` and publishes a Claude Code guide. Set the base URL, your MiniMax key and `MiniMax-M3.1-Flash[1m]` in `~/.claude/settings.json`, or run `npx -y mmx-cli@latest agent setup`.

**Which MiniMax model works with Claude Code?**
MiniMax-M3.1-Flash is the one MiniMax's guide configures, and MiniMax-M3 also works. The Anthropic interface accepts only those two. M2-series names in older guides no longer apply.

**How much does MiniMax cost in Claude Code?**
The M Plan is listed at $220 a year for Go, $550 for Explore and $1,320 for Build. Pay-as-you-go, MiniMax-M3.1-Flash is $0.15 per 1M input tokens and $0.60 per 1M output tokens.

**Why does Claude Code still use Claude after I configured MiniMax?**
Check for `ANTHROPIC_AUTH_TOKEN` and `ANTHROPIC_BASE_URL` exports in your shell profile and remove them, then restart Claude Code. Run `/status` and confirm the base URL points to `api.minimax.io/anthropic`.

**Where does MiniMax store my prompts?**
MiniMax's privacy policy for the international platform says personal data is stored in a data centre in the United States. The operator is Nanonoble Pte. Ltd. in Singapore. The China platform stores data in the People's Republic of China.

**Does MiniMax train on API prompts?**
Its Terms of Service allow it to use input and generated content to develop and improve its services. The pages we read do not offer an opt-out for API customers.

**Can I run MiniMax locally with Claude Code?**
Only on servers. MiniMax-M3.1-Flash is about 252 GB and MiniMax's reference is four NVIDIA B300 GPUs. The MiniMax entries in the Ollama library are hosted cloud models.

## Related guides

- AI coding on your own models: https://aventail.co.uk/guides/ai-coding-on-your-own-models
- Claude Code + Ollama: https://aventail.co.uk/guides/claude-code-ollama
- Claude Code + GLM: https://aventail.co.uk/guides/claude-code-glm
- Claude Code + Kimi: https://aventail.co.uk/guides/claude-code-kimi
- Claude Code with: https://aventail.co.uk/guides/claude-code-with-aventail-connect
  Aventail: https://aventail.co.uk/guides/claude-code-with-aventail-connect
  ™: https://aventail.co.uk/guides/claude-code-with-aventail-connect Connect: https://aventail.co.uk/guides/claude-code-with-aventail-connect
- Route local models and cloud APIs: https://aventail.co.uk/guides/route-local-models-and-cloud-apis

## Sources

1. MiniMax, Claude Code (M Plan): https://platform.minimax.io/docs/m-plan/claude-code
2. MiniMax, M Plan introduction: https://platform.minimax.io/docs/m-plan/intro
3. MiniMax, M Plan pricing page: https://www.minimax.io/m-plan
4. MiniMax, Anthropic SDK compatibility: https://platform.minimax.io/docs/api-reference/text-anthropic-api
5. MiniMax, Models: https://platform.minimax.io/docs/guides/models-intro
6. MiniMax, Pricing overview: https://platform.minimax.io/docs/pricing/overview
7. MiniMax, Token Plan updates: https://platform.minimax.io/docs/m-plan/token-plan-notice
8. MiniMax, Run and self-host MiniMax Open Models: https://platform.minimax.io/docs/guides/local-deploy
9. MiniMax, Self-host MiniMax-M3.1-Flash: https://platform.minimax.io/docs/guides/local-deploy-m3-1-flash
10. MiniMax API Privacy Policy (30 March 2026): https://platform.minimax.io/protocol/privacy-policy
11. MiniMax Terms of Service (effective 30 March 2026): https://platform.minimax.io/docs/guides/terms-of-service
12. MiniMax China platform, Claude Code guide and privacy policy (effective 13 November 2026): https://platform.minimaxi.com/docs/m-plan/claude-code and https://platform.minimaxi.com/protocol/privacy-policy
13. Hugging Face, MiniMaxAI: MiniMax-M3.1-Flash (model card and licence), MiniMax-M3, MiniMax-M2.7: https://huggingface.co/MiniMaxAI
14. Hugging Face, unsloth/MiniMax-M3.1-Flash-GGUF: https://huggingface.co/unsloth/MiniMax-M3.1-Flash-GGUF
15. Ollama library: minimax-m3.1-flash, minimax-m3: https://ollama.com/search?q=minimax
16. Anthropic, Claude Code setup: https://code.claude.com/docs/en/setup
17. Anthropic, Claude Code environment variables: https://code.claude.com/docs/en/env-vars
18. Anthropic, Model configuration: https://code.claude.com/docs/en/model-config
19. Anthropic, Other LLM gateways: https://code.claude.com/docs/en/llm-gateway
20. Anthropic, Feature availability: https://code.claude.com/docs/en/feature-availability
21. Aventail ™, Connect overview: https://docs.aventail.co.uk/docs/connect/overview
22. Aventail ™, Routing: https://docs.aventail.co.uk/docs/fleet/routing
23. Aventail ™, Compatibility and versions: https://docs.aventail.co.uk/docs/introduction/versions-and-supported-models
24. Aventail ™ Server: https://aventail.co.uk/inference-providers
25. Aventail ™, Pricing: https://aventail.co.uk/#pricing

All sources were read on 15 November 2026.

We use optional cookies and tracking to identify visiting companies, load our contact form, measure Google Ads download clicks and understand page use with PostHog on our homepage, Connect and How it works pages, Ollama and LM Studio comparison guides and campaign pages. Cookie policy (https://aventail.co.uk/cookies)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://aventail.co.uk/#organization",
      "name": "Aventail",
      "alternateName": "Locai",
      "legalName": "Loc.ai Ltd",
      "description": "Aventail, formerly Locai, was founded in 2026 and is a graduate of Google AI First. It gives enterprises the full AI stack to adopt AI securely: a built-in inference engine, deployment of supported models across approved hardware, on-device classification and policy-based routing between those machines and approved external AI providers, central management and an employee workspace. Organisations use Aventail to put approved information to work while controlling where inference requests run.",
      "url": "https://aventail.co.uk/",
      "logo": "https://aventail.co.uk/apple-touch-icon.png",
      "email": "hello@aventail.co.uk",
      "hasCredential": [
        {
          "@type": "EducationalOccupationalCredential",
          "name": "Cyber Essentials",
          "credentialCategory": "certification",
          "url": "https://aventail.co.uk/trust#cyber-essentials"
        }
      ]
    },
    {
      "@type": "Article",
      "@id": "https://aventail.co.uk/guides/claude-code-minimax#page",
      "url": "https://aventail.co.uk/guides/claude-code-minimax",
      "name": "Claude Code + MiniMax: M3.1 Flash setup, limits and where your code goes",
      "description": "Run Claude Code on MiniMax M3.1 Flash: the base URL and settings from MiniMax's docs, M Plan, what breaks, where prompts are stored and the self-hosted path.",
      "publisher": {
        "@id": "https://aventail.co.uk/#organization"
      },
      "headline": "Claude Code + MiniMax: M3.1 Flash setup, limits and where your code goes",
      "datePublished": "2026-11-23",
      "dateModified": "2026-11-23T19:37:53.694136+00:00",
      "image": "https://aventail-ai-platform.lovable.app/images/share/og-home-v7.jpg",
      "author": {
        "@id": "https://aventail.co.uk/#organization"
      }
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://aventail.co.uk/guides/claude-code-minimax#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://aventail.co.uk/"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Guides",
          "item": "https://aventail.co.uk/guides"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Claude Code + MiniMax: M3.1 Flash setup, limits and where your code goes",
          "item": "https://aventail.co.uk/guides/claude-code-minimax"
        }
      ]
    }
  ]
}
```