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 documents Anthropic-compatible and OpenAI-compatible request formats. Protocol compatibility does not by itself establish identical client behaviour or feature support.
| 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 |
The examples below use the international platform. Our streaming measurements use the China base URL https://api.minimax.cn/v1; its Anthropic base URL is https://api.minimax.cn/anthropic. Match your key and platform, and keep their prices separate.
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.
Our streaming measurements
Our testing — 23 October 2026. We made sequential, streamed Chat Completions requests from one Linux client for three code-repair tasks. Both providers received the same task text, low effort and the same output budget. The primary series repeats each task three times per provider at 4,096 tokens; a separately frozen diagnostic repeats each task once at 16,384 after truncations appeared. No request retry replaces a result.
| Series / route | Requests | Generated TTFT, median | First answer, median (observed n) | Request time, median | Native generation TPS, median |
|---|---|---|---|---|---|
| 4,096 primary; MiniMax (China) | 9 | 1.80 s | 14.52 s (9/9) | 16.97 s | 74.91 |
| 4,096 primary; DeepSeek | 9 | 0.71 s | 11.28 s (5/9) | 22.25 s | 183.46 |
| 16,384 diagnostic; MiniMax (China) | 3 | 1.51 s | 8.79 s (3/3) | 10.59 s | 79.06 |
| 16,384 diagnostic; DeepSeek | 3 | 0.76 s | 27.96 s (3/3) | 28.93 s | 182.17 |
Timing definitions are part of the result, not interchangeable labels:
- Generated TTFT: request start to the first nonempty reasoning or answer delta. Empty role events and keep-alives do not count.
- First-answer time: request start to the first nonempty answer-text delta, which may be the opening code fence. It is not the time until all code is usable. A truncated reasoning-only response has no first-answer time.
- Total request time: request start to stream completion, including connection setup and reasoning, before local grading.
- Native generation TPS: the API-reported completion-token count divided by the interval between first and last generated deltas, including reasoning. This is an approximate client-side chunk measurement, not visible-code tokens/s or a reproduction of a vendor’s throughput setup.
First-answer medians use only runs with an answer delta, with that denominator shown. Other timing medians include all recorded requests in the row, including truncations. The two providers tokenize text differently; identical character counts do not imply identical token counts. Cache hits, route, start time, output cap and finish reason remain in the raw records.
Token-based cost estimates, not actual bills
| Series / route | Estimated total across all attempts | Estimated total / successful attempts |
|---|---|---|
| 4,096 primary; MiniMax (China) | CNY 0.046272 | CNY 0.005141 |
| 4,096 primary; DeepSeek | USD 0.035528 peak / 0.017764 off-peak | USD 0.008882 peak / 0.004441 off-peak |
| 16,384 diagnostic; MiniMax (China) | CNY 0.013989 | CNY 0.004663 |
| 16,384 diagnostic; DeepSeek | USD 0.019087 peak / 0.009544 off-peak | USD 0.006362 peak / 0.003181 off-peak |
For the tested MiniMax China route, the reviewed list rates are CNY 1.00 per million uncached input tokens, CNY 0.10 cached input and CNY 4.00 output. The international USD rates elsewhere on this page do not apply to these records. DeepSeek scenarios use its published USD peak and off-peak rates; no currency conversion is applied.
The estimate is (uncached input × input rate + cached input × cache rate + completion × output rate) / 1,000,000. Reported reasoning tokens are already within completion tokens and are not added a second time. All attempts, including truncated output, contribute to each series’ estimate. These totals do not establish a per-request invoice, subscription charge, credit deduction or native mcode cost.
Download the kit, per-request primary records, higher-budget records, and computed summary. The DeepSeek comparison explains the coding checks and budget-related failures. This is a small low-concurrency client sample; it does not establish load capacity, global-endpoint speed, a population success rate or performance at max effort.
Measuring throughput: TPS
MiniMax documents its throughput formula below. To compare a measurement, first check whether its token count and timing interval include reasoning and whether the setup matches:
$$ \text{TPS} = \frac{\text{number of output tokens}}{\text{time of last token} - \text{time of first token}} $$
That interval excludes time before the first counted token. It does not by itself specify whether a particular provider counts reasoning tokens. Keep throughput, first-generated-token time, first-answer time and complete-task time separate. Published figures are setup-specific 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 23, 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 China API pricing (tested route; CNY)
- DeepSeek official pricing (comparison route)
- 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)