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.

Reviewed China streaming samples tested; global, long-context and multimodal examples remain unverified

Supported model IDs

Model IDWhere it is usedNotes
MiniMax-M3.1-FlashDirect API callsThe current name
MiniMax-M3.1-Flash[1m]Claude Code configurationThe [1m] suffix requests the long-context behaviour in the agent harness
MiniMax-M3.1-Flash-PreviewRetiredPreview 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.

FamilyCurrent identifiersNote
TextMiniMax-M3.1-Flash
MiniMax-M3
M3.1 Flash is the one to use; M3 steps its price up above 512k input
VideoMiniMax-H3
MiniMax-H3-Max
MiniMax-Hailuo-2.3
MiniMax-Hailuo-2.3-Fast
MiniMax-Hailuo-02
Billed per second of output, not per token
Speechspeech-2.8-hd
speech-2.8-turbo
speech-2.6-hd
speech-2.6-turbo
speech-02-hd
speech-02-turbo
Text-to-speech; hd for quality, turbo for speed
Imageimage-01
image-01-live
image-01-live takes a text prompt plus a reference image
MusicDiscontinuedThe 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.

FormatBase URLRecommendation
Anthropic-compatiblehttps://api.minimax.io/anthropicOfficial recommendation — supports thinking blocks and interleaved thinking
OpenAI-compatiblehttps://api.minimax.io/v1Use 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:

EffortWhen it makes sense
lowCheap classification, extraction, formatting
mediumEveryday assistant work
highMulti-step coding with clear requirements
xhighDifficult refactors, long-horizon agent tasks
maxThe 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

LimitValue
Context window (input)1,000,000 tokens
Maximum output524,288 tokens
Output modalitiesText only
ThinkingAlways 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 / routeRequestsGenerated TTFT, medianFirst answer, median (observed n)Request time, medianNative generation TPS, median
4,096 primary; MiniMax (China)91.80 s14.52 s (9/9)16.97 s74.91
4,096 primary; DeepSeek90.71 s11.28 s (5/9)22.25 s183.46
16,384 diagnostic; MiniMax (China)31.51 s8.79 s (3/3)10.59 s79.06
16,384 diagnostic; DeepSeek30.76 s27.96 s (3/3)28.93 s182.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 / routeEstimated total across all attemptsEstimated total / successful attempts
4,096 primary; MiniMax (China)CNY 0.046272CNY 0.005141
4,096 primary; DeepSeekUSD 0.035528 peak / 0.017764 off-peakUSD 0.008882 peak / 0.004441 off-peak
16,384 diagnostic; MiniMax (China)CNY 0.013989CNY 0.004663
16,384 diagnostic; DeepSeekUSD 0.019087 peak / 0.009544 off-peakUSD 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 region

Error handling

MiniMax publishes a dedicated error-code page. The most common failure modes when adopting this model are not API errors but configuration errors:

SymptomLikely cause
model not found for a preview-era nameUsing the retired MiniMax-M3.1-Flash-Preview identifier
Request rejected for context lengthExceeding the 1M input window, or the harness not applying the [1m] model suffix
Bill much higher than expectedEffort 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.

Spotted something out of date? Suggest a correction →

Your next step