MiniMax M4: What It Is, What It Costs, and How to Start
How MiniMax M4 handles long coding tasks, what its benchmark scores measure, where to try it, and how to make your first API call.
Published

MiniMax M4 gives a coding agent room to read a bug report, the files it touches and a long trail of test output together. MiniMax released the model on December 3, 2026, with a 1-million-token context window. Developers can call it through an API today. Teams that need to run it on their own machines are still waiting for the weights.
What fits in the MiniMax M4 context window?
A context window is the amount of material a model can consider in one request. Models count input and output in small units called tokens. A word can span several tokens. For a coding agent, that window has to hold more than source files. Imagine tracking down a checkout bug: the payment handler looks fine in isolation, but a test fixture uses an old field name and the failure only appears in a log. The advantage of a large window is that the agent can inspect all three together and still have room for the results of its next test.
M4 is a mixture of experts model. MiniMax gives two sizes: 2.74 trillion parameters in total, with 66 billion active per token. Parameters are the learned values that shape a prediction. A mixture of experts selects parts of the network for each token, so the first figure describes the whole model and the second describes the portion doing work on that token.
M4 can take text, images and video as input. A developer can include a screenshot of the broken checkout alongside the code. Someone who wants to generate a video should look at MiniMax H3, which MiniMax lists separately in its model catalog.
How M4 handles a long session on different chips
The longer the conversation, the more intermediate information a model has to keep nearby to generate the next token. Think of a mapmaker with a small desk and a deep set of drawers. The desk holds the sheets in use and an index. As the mapmaker finishes one sheet, an assistant fetches the next.
MiniMax calls the two parts of its design MiniMax Sparse Attention 2 (MSA2) and MFlashKV. MSA2 selects relevant blocks of earlier context and predicts which blocks the model will need next. During generation, MFlashKV keeps frequently used blocks and their indices in fast chip memory and puts most of the remaining key/value cache, the saved work from earlier tokens, on solid-state drives. MiniMax names Huawei’s 950DT and T-Head’s Zhenwu M890 SuperNode among the hardware this design lets it use.

What MiniMax measured on coding tasks
MiniMax gave M4 an empty directory and a 24-hour window to build a desktop browser without using an existing browser engine. The company reports more than 4,000 tool calls as the model wrote Rust and debugged its own rendered output. That example shows what MiniMax means by a long task: the agent changes code, inspects what happened and revises its work over many turns.
The benchmark scores are easier to interpret with the evaluator attached. In its technical report, Table 2 and Appendix B, MiniMax reports 40.0 on ProgramBench from its own evaluation using OpenCode. On Terminal Bench 4.1, MiniMax lists 56.6 for M4 and 68.2 for Kimi K3.1 Pro, sourcing the Kimi score from Artificial Analysis. MiniMax reports its main M4 results at maximum reasoning effort.
One qualification matters if you saw the WebDev leaderboard: MiniMax says its M4 entry used automated evaluation, while competitors’ ratings came from human votes. If your product owner cares whether the generated checkout feels right, have the same reviewer use both versions. A different judge can change what a score tells you.
Where you can use M4 today
MiniMax’s API is the direct route for an application. Its API pricing is $0.80 per million input tokens, $3.10 per million output tokens and $0.05 per million cached input tokens read.
M Plan is the coding subscription. It includes access through MiniMax Code and publishes setup guides for editors and agents including Cursor and Claude Code. Choose this route if the person doing the work wants to use M4 from a coding tool. For the company’s broader product lineup, see the MiniMax AI review.
OpenRouter lists the model as minimax/minimax-m4. On December 4 its only listed provider was MiniMax, marked provisional. If your account excludes provisional providers, that setting matters before you try the request.
Vercel AI Gateway uses the same minimax/minimax-m4 identifier. Vercel’s example passes it to the AI SDK and asks for a TypeScript debounce function. For an app that already routes through Gateway, that makes a small, isolated first request. Vercel says zero data retention for M4 will become available as more providers add support. If your workload requires that guarantee, wait for the M4-specific update.
Can you download the weights?
MiniMax had yet to publish downloadable M4 weights when we checked on December 4, 2026. The official M4 repository contains the technical report and figures. The weights are the learned values you would need to run the model yourself. MiniMax says it hopes to release them within the next few weeks, after internal and third-party safety evaluations. It gives no fixed date.

Make your first MiniMax API call
Start with a short text request so you can check credentials, the model ID and the response before giving an agent a repository.
- Sign in to the MiniMax API Platform. For pay-as-you-go, open API Keys, choose Create new secret key, then top up under Billing → Balance if needed. M Plan users get their Subscription Key under Billing → M Plan and need an active seat or credits. MiniMax account setup
- In Bash, run
read -rsp 'MiniMax key: ' MINIMAX_API_KEYand paste your key at the hidden prompt. The command below uses that variable in the same shell. - Send this request. It uses the direct model ID,
MiniMax-M4, and the message format from MiniMax’s model invocation guide.
curl --silent --show-error https://api.minimax.io/anthropic/v1/messages \
-H "Authorization: Bearer ${MINIMAX_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M4",
"max_tokens": 4096,
"output_config": {"effort": "low"},
"messages": [
{"role": "user", "content": "Write a TypeScript function that debounces another function."}
]
}'Look for a text block in the response’s content array. Reasoning is always on, and its tokens count toward max_tokens. If you receive stop_reason: "max_tokens" with no text, the model may have spent the allowance reasoning. When you add tools, preserve the full assistant content between turns, including thinking and tool-use blocks. Saving only the visible reply loses part of the history the next call expects. MiniMax’s API compatibility notes
When to try M4 alongside your current model
A team that spends hours reviewing agent-written changes should try M4 on a closed issue with a known acceptance test. Give both models the same starting commit, tools and time allowance. Keep the final patch, the test result, the amount billed for every attempt and the minutes a developer spends on review. A cheap run that needs a second attempt and a rewrite can be the more expensive way to close the issue.
Use the model you already pay for as the baseline. If that is GLM-5.4 or DeepSeek V4, record the exact variant you run. MiniMax’s launch table includes GLM-5.3 and DeepSeek-V4.1-Flash-1017; a score for one version cannot settle a choice involving another. The guide to Chinese AI models gives the wider shortlist. If your current workload is short, inexpensive and already meets its acceptance criteria, there is little reason to move it. Save the trial for a job where long context or repeated tool calls matter.
Is MiniMax AI better than ChatGPT?
That depends on the job and the model behind your ChatGPT session. For coding, compare the same issue with the same tools and ask a reviewer to accept or reject each patch.
Is MiniMax a Chinese model?
Yes. MiniMax is the Chinese company behind M4. Its model family also includes H3 for video.
Is MiniMax AI free or paid?
The direct M4 API is metered, and M Plan is a paid subscription. A public GitHub repository does not give you a free local copy of M4.
How much does MiniMax AI cost?
For the direct M4 API, use the three token rates above. Input, cached input reads and generated output have different prices. M Plan is billed separately.
Is MiniMax cheaper than DeepSeek?
Compare the exact models on a finished task. Include cached reads, generated tokens and retries for both, then divide each total bill by the number of accepted results.
Who is behind MiniMax AI?
MiniMax develops its own foundation models. OpenRouter and Vercel provide hosted access to M4.
How is MiniMax so cheap?
MiniMax credits its selective use of experts and its memory design with making M4 efficient to serve. The API rate tells you what you pay; it does not reveal the company’s margin.
Is MiniMax making money?
MiniMax reported revenue and an adjusted net loss in its interim results for the first half of 2026. Those results predate M4’s launch.
Is MiniMax AI safe?
For a coding pilot, give the agent a disposable checkout, a test command and no production credentials. For sensitive material, verify retention on the route you choose. MiniMax’s planned pre-release safety evaluations do not establish how a hosted provider handles your prompts.
- Published
- Category
- AI











