MiniMax M4 brings a 1M-token context window to coding agents. Compare it with M3.1 Flash and Claude Fable 5.2, and calculate what caching and deeper reasoning do to the bill.
MiniMax M4 is worth evaluating first for screenshot-driven fixes and code changes that need evidence from across a repository. It has a 1,000,000-token context window, the same size as MiniMax M3.1 Flash. The reason to upgrade is better results on some harder tasks, at a higher cost per run. MiniMax's direct API charges $0.80 for uncached input, $3.10 for output and $0.05 for cache reads per million tokens. For short, repetitive work with clear acceptance criteria, Flash gives you a cheaper baseline. MiniMax model documentation · MiniMax API pricing · Vals Index
MiniMax M4 specifications and API availability #
| Item | MiniMax M4 at launch |
|---|---|
| MiniMax API release notes | December 3, 2026 |
| Official API model ID | MiniMax-M4 |
| Architecture | Multimodal mixture of experts (MoE), 2.74 trillion total parameters, 66 billion active per token |
| Context window | 1,000,000 tokens |
| Modalities | Text and image input, text output, tool calling |
| Reasoning effort | low ,medium ,high ,xhigh ,max . The default ismax . |
| Access | MiniMax API, M Plan and MiniMax Code. Public model weights are pending. |
Treat the context window as the budget for a conversation that grows with each tool result and response. Keep a separate output limit. Vals AI configured a 262,144-token output limit for its M4 evaluation. Confirm the actual output cap with your provider before budgeting a long run around that figure. MiniMax release notes · MiniMax M4 research announcement · MiniMax model documentation · Vercel AI Gateway launch · Vals M4 configuration
How M4 handles a million tokens #
The 66 billion active parameters are about 2.4% of the 2.74 trillion total. The MoE router selects a subset of experts as it processes each token. That helps limit per-token computation. A serving cluster still has to make the full set of experts available. A raw 8-bit representation of all weights would occupy roughly 2.74 TB in decimal units, before runtime memory, quantization metadata and the KV cache. That arithmetic gives a sense of the scale of self-hosting M4. MiniMax M4 research announcement
The long-context changes target a different bottleneck. MSA2 uses sparse attention across all 68 attention layers, so each step reads selected blocks of the key/value (KV) state from earlier tokens. MFlashKV keeps frequently accessed blocks and indices in high-bandwidth memory (HBM) and moves most KV data to solid-state storage. MiniMax reports a quarter of the previous version's KV cache requirement per token, with 4.48× prefill throughput and 8× decoding throughput in its comparison. Those are figures for MiniMax's inference stack. An agent's elapsed time also includes queueing, image processing, tool calls and the new tokens generated at every turn. MiniMax M4 research announcement
For a repository agent, reserve the long window for evidence the model needs to revisit, such as a failing screenshot, a shared interface and the test that constrains it. Compare a compact prompt against a long one on the same issue. Keep the extra files if they improve patch acceptance or reduce follow-up reads. Record uncached input, time to first token and time to a verified patch separately so you can see where a longer prompt pays off.
MiniMax M4 vs. M3.1 Flash and Claude Fable 5.2 #
On the December 2026 Vals Index snapshot, M4 scored 61.65%, up 9.90 percentage points from M3.1 Flash, at roughly 3.6× the reported cost per test. Vals ran M4 through MiniMax with max effort. The rows reflect Vals' own provider and settings for each model. Vals Index leaderboard and methodology · Vals M4 configuration
| Model | Vals Index | Reported cost per test |
|---|---|---|
| MiniMax M3.1 Flash | 51.75% | $0.66 |
| MiniMax M4 | 61.65% | $2.35 |
| GPT-6.2 Sol | 65.07% | $3.18 |
| Claude Fable 5.2 | 70.06% | $17.94 |
The shape of the task changes the decision. On SWE-bench Multimodal, which includes JavaScript issues reported with screenshots, Vals recorded 58.54% at $0.28 per test for M4 and 62.29% at $1.84 for Claude Fable 5.2. That is a reason to pilot M4 on screenshot-driven work with automated checks or a reviewer. Vals SWE-bench Multimodal
On Terminal-Bench 4.0, with Mini-SWE-agent as the harness for both models, M4 scored 44.95% and Fable 5.2 scored 65.15%. That gap matters when a run has to recover from tool failures and finish a long sequence under a deadline. Compare results within each benchmark and harness. Use your project's completion criteria to decide which model gets an expensive, hard-to-retry task. Vals Terminal-Bench 4.0
How much does MiniMax M4 cost with a warm cache? #
These are MiniMax's direct pay-as-you-go list rates, in USD per million tokens. The KV optimizations described above reduce serving memory. Cache-read billing depends on how many input tokens the API reports as reused from an earlier request. For example, the Anthropic-compatible API reports these in usage.cache_read_input_tokens. MiniMax API pricing · MiniMax prompt caching
| Model | Uncached input | Cache read | Output |
|---|---|---|---|
MiniMax-M4 |
$0.80 | $0.05 | $3.10 |
MiniMax-M3.1-Flash |
$0.15 | $0.015 | $0.60 |
The worksheet below assumes 100,000 input tokens in total and 10,000 billable output tokens per request. The warm case reads 80,000 input tokens from cache and sends the remaining 20,000 as uncached input. Multiply each token count by its rate and divide by 1,000,000.
| Illustrative request | MiniMax M4 | MiniMax M3.1 Flash |
|---|---|---|
| Cold, 100,000 uncached input tokens | $0.1110 | $0.0210 |
| Warm, 80,000 cached and 20,000 uncached input tokens | $0.0510 | $0.0102 |
On M4, the assumed cache hit saves $0.060. If a deeper reasoning run uses another 20,000 billable output tokens, that adds $0.062 at the same rate. A stable cached prefix and an explicit reasoning budget address different parts of the bill. This example covers the three listed token charges. For a full workflow, add any other billed items, tool fees, retries and human review. Modelflare guide to cost per successful task
What changes when you plug M4 into an agent? #
MiniMax enables reasoning on every M4 request. For direct access on api.minimax.io, MiniMax recommends Anthropic-compatible /anthropic/v1/messages and documents /v1/chat/completions for existing OpenAI clients. Set the effort explicitly in a comparison. An omitted field selects max. MiniMax model invocation and reasoning fields
| Protocol | Request field for effort | Where the client receives reasoning |
|---|---|---|
| Anthropic-compatible Messages | output_config.effort |
thinking content blocks |
| OpenAI-compatible Chat Completions | reasoning_effort |
reasoning_content |
| OpenAI Responses | reasoning.effort |
Output items of type reasoning |
Start compatibility checks with a complete tool round trip. The client receives a proposed tool call, executes the allowed tool and returns its result with the matching call ID. MiniMax's SDK guides require sending the complete assistant response in the next turn's message history, including the returned tool call and reasoning content. Verify streaming, output limits and usage reporting on the actual route you plan to use. The field mapping here comes from the published docs. MiniMax OpenAI SDK guide · MiniMax Anthropic SDK guide
| Workload | First comparison | Acceptance criteria |
|---|---|---|
| Short edits and repetitive extraction | M3.1 Flash vs. M4 at the same effort | Schema validity or tests passed, latency tail and cost per accepted result |
| Screenshot-driven fixes and cross-file changes | M4 at medium vs. Flash or the current production model |
A patch that passes tests and review, time to completion and paid retries |
| Long tool sequences with difficult recovery | M4 at two effort levels vs. the current production model | Delivery within the time budget, human interventions and recovery after interruption |
Use the same repository snapshot, screenshots, tools and stopping rules for each pair. Divide total spend for each route by its accepted results, including the expense of unsuccessful attempts in the numerator. Promote M4 only in the workloads where it meets the acceptance and latency targets at a cost the team can justify. Modelflare guide to routing by cost and quality
Can you self-host M4 or call it through Modelflare? #
The MiniMax API is available and the public weights are pending. MiniMax says it plans to release weights after internal and third-party safety evaluations. For self-hosting, confirm the weight files, license and supported inference runtimes once MiniMax publishes them. MiniMax M4 research announcement · MiniMax model documentation
Modelflare availability. The December 4 check of Modelflare's public model catalog found MiniMax-H3, a video model. MiniMax-M4 had yet to be listed. The token rates above are for the MiniMax direct API. Check the live catalog for Modelflare availability and prices. Modelflare models and pricing · Modelflare public pricing API
Update record #
- December 4, 2026 · Initial analysis. Checked the provider's API documentation, published prices, weight-release status, Vals results and the Modelflare public model catalog. The cost worksheet uses illustrative token counts. Benchmark figures come from the cited evaluators and providers.