MiniMax M4 overview
MiniMax M4 by MiniMax
MiniMax M4 is MiniMax's open-weight flagship model. It has 2.74 trillion total parameters, 66 billion active parameters per token and a 1M-token context window.
MiniMax M4 specs
- Model ID
minimax/minimax-m4- Developer
- MiniMax
- Context window
- 1,000,000 tokens
- Max output
- 262,144 tokens
- Input
- Image, Text, Video
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
Reasoning and attention built for long inputs
MiniMax says M4 reasons before answering by breaking complex problems into steps. A single response can run up to 262,144 tokens.
To make the long window practical, M4 uses the MSA2 sparse-attention mechanism in all 68 attention layers. MiniMax reports that, compared with the previous version, MSA2 cuts per-token key-value cache needs by 4×. It also raises prefilling throughput by 4.48× and decoding throughput by 8×. Before relying on the long window, test it with a full-size document or repository from your own work.
Set the reasoning effort
The reasoning effort option controls how much the model reasons before it answers. Lower values give faster responses and use fewer tokens on reasoning. The default is max.
Start with the default and read the answers on your hardest prompts. Then try low or medium on short, simple prompts. Compare answer quality and response time against the default before you switch.
Where M4 fits next to M3.1 Flash
MiniMax recommends M4 for coding, domain knowledge, reinforcement-learning-system work, chip design, finance and business, and computer use. It also recommends it for design tasks involving 3D modeling, games and video production. MiniMax reports a score of 38.2 for M4 on Posttrain Bench v1.2.
MiniMax M3.1 Flash is the related model to compare. It accepts text, image and video input and is built for coding, multi-step agent workflows and visual understanding. Run both on the same set of prompts from your own project before choosing one.
Use cases
Refactor or debug a large codebase by sending many files in one request and asking for a plan before the edits.
Run an agent that calls tools across many steps and reasons about each result before the next call.
Analyze a long report, contract or transcript in a single prompt and return structured output.
Review screenshots, design mockups or video clips as input to a coding or design task.
Capabilities
- Reasoning
- Streaming
- Structured outputs
- Function calling
- Vision
MiniMax M4 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.8 | 1M tokens |
| Output | $3.1 | 1M tokens |
| Cached input | $0.05 | 1M tokens |
Prices from the AI/ML API price list, checked on Dec 3, 2026.
MiniMax M4 vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.8 | $3.1 | |
| $0.15 | $0.6 | |
| $0.3 | $1.2 | |
| $0.3 | $1.2 | |
| $0.6 | $2.4 |
How to use the MiniMax M4 API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "minimax/minimax-m4",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "minimax/minimax-m4",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "minimax/minimax-m4",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
MiniMax M4 FAQ
How much does MiniMax M4 cost?
MiniMax M4 costs $0.8 / 1M tokens for input and $3.1 / 1M tokens for output on AI/ML API. Cached input is billed at $0.05 / 1M tokens.
What inputs does MiniMax M4 accept?
It accepts text, image and video input and returns text. Streaming, structured output and tool calling are supported.
How do I control how much the model reasons?
Use the reasoning effort option. The default is max, and lower values give faster responses with fewer tokens spent on reasoning.
How long can a response be?
The maximum output is 262,144 tokens.
What changed against the previous version?
MiniMax says the MSA2 attention mechanism lowers key-value cache needs per token by 4×. It reports prefilling throughput 4.48× higher and decoding throughput 8× higher than the previous version.
What is the MiniMax M4 model ID?
Use minimax/minimax-m4 as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.
What is the context window of MiniMax M4?
MiniMax M4 accepts up to 1,000,000 tokens of context and returns up to 262,144 output tokens.


