{"slug": "minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing", "title": "MiniMax M4 Deep Dive on Long-Context Coding, Benchmarks and API Pricing", "summary": "MiniMax released MiniMax M4 on December 3, 2026, a multimodal mixture-of-experts model with 2.74 trillion total parameters, 66 billion active per token, and a 1,000,000-token context window, priced through MiniMax's direct API at $0.80 per million uncached input tokens, $3.10 per million output tokens and $0.05 per million cache reads. MiniMax reports MSA2 sparse attention across all 68 attention layers and MFlashKV offloading cut KV cache per token to a quarter of the previous version, with 4.48× prefill and 8× decoding throughput on its own inference stack. The model offers five reasoning-effort settings (low, medium, high, xhigh, max, defaulting to max) and is available via the MiniMax API, M Plan and MiniMax Code, with public model weights pending.", "body_md": "# MiniMax M4 Deep Dive on Long-Context Coding, Benchmarks and API Pricing\n\nMiniMax 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.\n\n**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](https://platform.minimax.io/docs/guides/text-generation) · [MiniMax API pricing](https://platform.minimax.io/docs/pricing/overview) · [Vals Index](https://www.vals.ai/benchmarks/vals_index)\n\n## MiniMax M4 specifications and API availability\n\n| Item | MiniMax M4 at launch | \n|---|---|\n| MiniMax API release notes | December 3, 2026 | \n| Official API model ID | `MiniMax-M4` | \n| Architecture | Multimodal mixture of experts (MoE), 2.74 trillion total parameters, 66 billion active per token | \n| Context window | 1,000,000 tokens | \n| Modalities | Text and image input, text output, tool calling | \n| Reasoning effort | `low` ,`medium` ,`high` ,`xhigh` ,`max` . The default is`max` . | \n| Access | MiniMax API, M Plan and MiniMax Code. Public model weights are pending. | \n\nTreat 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](https://platform.minimax.io/docs/release-notes/models) · [MiniMax M4 research announcement](https://www.minimax.io/blog/m4) · [MiniMax model documentation](https://platform.minimax.io/docs/guides/text-generation) · [Vercel AI Gateway launch](https://vercel.com/changelog/minimax-m4-now-available-on-ai-gateway) · [Vals M4 configuration](https://www.vals.ai/models/minimax_MiniMax-M4)\n\n## How M4 handles a million tokens\n\nThe 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](https://www.minimax.io/blog/m4)\n\nThe 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](https://www.minimax.io/blog/m4)\n\nFor 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.\n\n## MiniMax M4 vs. M3.1 Flash and Claude Fable 5.2\n\nOn 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](https://www.vals.ai/benchmarks/vals_index) · [Vals M4 configuration](https://www.vals.ai/models/minimax_MiniMax-M4)\n\n| Model | Vals Index | Reported cost per test | \n|---|---|---|\n| MiniMax M3.1 Flash | 51.75% | $0.66 | \n| MiniMax M4 | 61.65% | $2.35 | \n| GPT-6.2 Sol | 65.07% | $3.18 | \n| Claude Fable 5.2 | 70.06% | $17.94 | \n\nThe 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](https://www.vals.ai/benchmarks/swebench-multimodal)\n\n**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](https://www.vals.ai/benchmarks/terminal-bench-4)\n\n## How much does MiniMax M4 cost with a warm cache?\n\nThese 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](https://platform.minimax.io/docs/pricing/overview) · [MiniMax prompt caching](https://platform.minimax.io/docs/api-reference/text-prompt-caching)\n\n| Model | Uncached input | Cache read | Output | \n|---|---|---|---|\n| `MiniMax-M4` | $0.80 | $0.05 | $3.10 | \n| `MiniMax-M3.1-Flash` | $0.15 | $0.015 | $0.60 | \n\nThe 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.\n\n| Illustrative request | MiniMax M4 | MiniMax M3.1 Flash | \n|---|---|---|\n| Cold, 100,000 uncached input tokens | $0.1110 | $0.0210 | \n| Warm, 80,000 cached and 20,000 uncached input tokens | $0.0510 | $0.0102 | \n\nOn 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](https://modelflare.dev/articles/llm-cost-per-successful-task)\n\n## What changes when you plug M4 into an agent?\n\nMiniMax 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](https://platform.minimax.io/docs/guides/text-generation#thinking)\n\n| Protocol | Request field for effort | Where the client receives reasoning | \n|---|---|---|\n| Anthropic-compatible Messages | `output_config.effort` | `thinking` content blocks | \n| OpenAI-compatible Chat Completions | `reasoning_effort` | `reasoning_content` | \n| OpenAI Responses | `reasoning.effort` | Output items of type `reasoning` | \n\nStart 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](https://platform.minimax.io/docs/api-reference/text-openai-api) · [MiniMax Anthropic SDK guide](https://platform.minimax.io/docs/api-reference/text-anthropic-api)\n\n| Workload | First comparison | Acceptance criteria | \n|---|---|---|\n| 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 | \n| 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 | \n| 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 | \n\nUse 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](https://modelflare.dev/articles/multi-model-routing-cost-quality)\n\n## Can you self-host M4 or call it through Modelflare?\n\n**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](https://www.minimax.io/blog/m4) · [MiniMax model documentation](https://platform.minimax.io/docs/guides/text-generation)\n\n**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](https://modelflare.dev/pricing) · [Modelflare public pricing API](https://modelflare.dev/api/pricing)\n\n## Update record\n\n- **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.", "url": "https://wpnews.pro/news/minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing", "canonical_source": "https://modelflare.dev/articles/minimax-m4-review-pricing", "published_at": "2026-12-04 05:05:01+00:00", "updated_at": "2026-12-04 05:15:30.575615+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-infrastructure", "ai-tools", "artificial-intelligence"], "entities": ["MiniMax", "MiniMax M4", "MiniMax M3.1 Flash", "Claude Fable 5.2", "Vals AI", "Vercel AI Gateway", "M Plan", "MiniMax Code"], "also_reported_by": [], "takeaway": "MiniMax M4's 1,000,000-token window costs $0.80 per million uncached input tokens and $0.05 per million cache reads, so reserve the long context for evidence the agent must revisit and record uncached input, time to first token and time to a verified patch separately.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing", "markdown": "https://wpnews.pro/news/minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing.md", "text": "https://wpnews.pro/news/minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing.txt", "jsonld": "https://wpnews.pro/news/minimax-m4-deep-dive-on-long-context-coding-benchmarks-and-api-pricing.jsonld"}}