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

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 accepts two request formats and they are equivalent for the same input.

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

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.

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 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 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.

Spotted something out of date? Suggest a correction →

Your next step