API
MiniMax M3.1 Flash API Guide
Two compatible endpoints, one model ID, an effort dial that defaults to max, and a 1M-token context window.
Supported model IDs
| Model ID | Where it is used | Notes |
|---|---|---|
MiniMax-M3.1-Flash | Direct API calls | The current name |
MiniMax-M3.1-Flash[1m] | Claude Code configuration | The [1m] suffix requests the long-context behaviour in the agent harness |
MiniMax-M3.1-Flash-Preview | Retired | Preview was folded into the GA model; requests using the old name are still routed to the GA model, but new code should not use it |
If you copied a configuration from a preview-era tutorial, the model name is the first thing to update.
The wider MiniMax model lineup
M3.1 Flash is one model in a broader catalog. These are the other identifiers you will meet, and which of them you actually want.
| Family | Current identifiers | Note |
|---|---|---|
| Text | MiniMax-M3.1-FlashMiniMax-M3 | M3.1 Flash is the one to use; M3 steps its price up above 512k input |
| Video | MiniMax-H3MiniMax-H3-MaxMiniMax-Hailuo-2.3MiniMax-Hailuo-2.3-FastMiniMax-Hailuo-02 | Billed per second of output, not per token |
| Speech | speech-2.8-hdspeech-2.8-turbospeech-2.6-hdspeech-2.6-turbospeech-02-hdspeech-02-turbo | Text-to-speech; hd for quality, turbo for speed |
| Image | image-01image-01-live | image-01-live takes a text prompt plus a reference image |
| Music | Discontinued | The whole music-* family is being withdrawn |
The retired text identifiers — MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.1, MiniMax-M2 and their -highspeed variants — are withdrawn for pay-as-you-go users on 18 November 2026. Full breakdown, including the M Plan rerouting rules, is on the model list.
Base URLs
MiniMax accepts two request formats and they are equivalent for the same input.
| Format | Base URL | Recommendation |
|---|---|---|
| Anthropic-compatible | https://api.minimax.io/anthropic | Official recommendation — supports thinking blocks and interleaved thinking |
| OpenAI-compatible | https://api.minimax.io/v1 | Use when the client only speaks OpenAI |
Calling examples
Anthropic-compatible, non-streaming:
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",
"output_config": {"effort": "max"},
"max_tokens": 4096,
"messages": [{"role": "user", "content": "Hi, how are you?"}]
}'Python with the Anthropic SDK:
import anthropic
client = anthropic.Anthropic(
base_url="https://api.minimax.io/anthropic",
api_key="<MINIMAX_API_KEY>",
)
message = client.messages.create(
model="MiniMax-M3.1-Flash",
output_config={"effort": "max"},
max_tokens=4096,
messages=[{"role": "user", "content": "Hi, how are you?"}],
)The OpenAI-compatible path uses https://api.minimax.io/v1/chat/completions with the model name MiniMax-M3.1-Flash.
Thinking and reasoning effort
M3.1 Flash is a reasoning model and thinking is always on. What you control is how deep it thinks:
| Effort | When it makes sense |
|---|---|
low | Cheap classification, extraction, formatting |
medium | Everyday assistant work |
high | Multi-step coding with clear requirements |
xhigh | Difficult refactors, long-horizon agent tasks |
max | The default. Hardest problems — and the most tokens |
Set it with output_config: {"effort": "..."} on the Anthropic-compatible endpoint. Two things trip people up: omitting the parameter gives you max, not a middle setting, and there is no “off” value, because the previous generation allowed reasoning to be disabled.
The practical consequence is on your invoice. The pricing page shows how reasoning tokens dominate the cost of a task.
Prompt caching
Cached prompt tokens are billed at $0.015 per million instead of $0.15 — a 90% discount. The MiniMax documentation has a dedicated prompt-caching page describing the cache write/read calls and the minimum cacheable prefix length.
In practice: put the stable prefix first (system prompt, tool definitions, long documents you keep re-reading) and the volatile part last, so repeated turns hit the cache.
Multimodal input
The model accepts text, image and video input, and returns text. The official GA page demonstrates this with visual analysis and frontend-generation tasks, including a reference-image workflow that produces an interactive Three.js scene.
Because video input is accepted, long video files can consume a large share of your context window. Check the token count of what you attach before sending it.
Limits
| Limit | Value |
|---|---|
| Context window (input) | 1,000,000 tokens |
| Maximum output | 524,288 tokens |
| Output modalities | Text only |
| Thinking | Always on, effort adjustable |
The 1M figure is an input limit and 524K is an output ceiling. They are different numbers and pages that blur them are usually quoting one and calling it the other.
Measuring throughput: TPS
MiniMax measures inference speed in tokens per second, and publishes the formula so the numbers are comparable:
$$ \text{TPS} = \frac{\text{number of output tokens}}{\text{time of last token} - \text{time of first token}} $$
Timing starts when the first token appears and stops when the last one does — the time to first token is deliberately excluded, so a model that thinks for a long time before answering is not penalised on TPS. TPS fluctuates during real use, and the figures shown on each model page are reference values rather than guarantees.
Checking subscription quota from the API
If you run on an M Plan subscription, you can read the remaining allowance directly instead of polling the console:
curl --location 'https://www.minimax.io/v1/token_plan/remains' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json'The MiniMax CLI exposes the same information as mmx quota.
Region matters
The global and mainland-China platforms are separate, and a key only works against the one it was issued for. The CLI normally detects this from the key, but if mmx auth login keeps returning 401, set the region by hand:
mmx config set --key region --value global # Global API Key
mmx config set --key region --value cn # Mainland China API Key
mmx auth status # confirm the active regionError handling
MiniMax publishes a dedicated error-code page. The most common failure modes when adopting this model are not API errors but configuration errors:
| Symptom | Likely cause |
|---|---|
model not found for a preview-era name | Using the retired MiniMax-M3.1-Flash-Preview identifier |
| Request rejected for context length | Exceeding the 1M input window, or the harness not applying the [1m] model suffix |
| Bill much higher than expected | Effort left at the max default, or prompt cache misses |
If you are wiring the model into a coding agent rather than calling the API directly, start with the Claude Code guide or the Codex guide — they cover the harness-specific parts, and the FAQ collects the recurring problems.
Sources and version notes
Checked October 21, 2026. We label official claims, third-party measurements, our own testing and community reports separately — see the sources policy for what each label means.
- MiniMax API docs: model invocation (model list, effort, endpoints, examples)
- MiniMax API docs: tool use and interleaved thinking
- MiniMax API docs: prompt caching
- MiniMax API docs: error codes
- MiniMax API docs: model list (available and retired models)
- MiniMax M Plan FAQ (checking usage, region configuration)