Jan Sverre Bauge

MiniMax M4 aims to keep AI coding for hours

MiniMax M4 has 3 trillion parameters, a 1 million-token context window and API access now. Here is what its price, long-horizon coding goal and promised open weights mean in practice.

MiniMax M4 working through a long AI coding task across a large codebase
MiniMax M4 combines 3 trillion total parameters, a 1 million-token context window and a focus on long-horizon AI coding.

If you use AI to work across large codebases for hours at a time, MiniMax M4 is built for exactly that kind of job. The model has 3 trillion total parameters, a 1 million-token context window and immediate access through the MiniMax API, M Plan and paid MiniMax Code plans.

It is an enormous model on paper. MiniMax says M4 can sustain complicated engineering work for hours instead of merely suggesting the next line of code or fixing one small function. The practical news is the combination of long context, heavy reasoning and access through familiar APIs.

Two things need to stay separate. The API model is available now, while the weights are promised for later with no published release date. And 3 trillion total parameters tell me remarkably little about how well the model will complete your job for the money. That has to be measured in real work, not inferred from the size of the number.

What is MiniMax M4?

MiniMax M4 is a new flagship model for AI coding, agents and long-running tasks. MiniMax lists 3 trillion total parameters and a 1 million-token context window. The model ID is MiniMax-M4, and developers can call it through both Anthropic-compatible and OpenAI-compatible APIs.

The total parameter count is huge, but MiniMax has not stated in its public documentation how many parameters are active for each token. Without that figure, the headline number does not let us calculate inference speed, memory requirements or the likely cost of running the weights locally.

MiniMax describes M4 as a model trained with large-scale reinforcement learning and aimed at long-horizon coding. In practice, that means it is supposed to plan, modify, check and continue through larger engineering tasks without losing the thread after a few steps. The company also highlights games, websites, 3D models and specialist fields such as cybersecurity and finance. Those are vendor claims, not an independent hands-on test.

Technical illustration of MiniMax M4 keeping a long coding task coherent across many steps
M4 is designed for agent tasks in which code, tests, tool calls and decisions must remain coherent across many steps.

Why does long-horizon coding matter more than model size?

The hard part of agentic coding is rarely writing one elegant function. The model has to understand an existing codebase, keep track of requirements, use tools, read test results and correct its own mistakes. When the work lasts for hours, planning and retrieving the right detail matter more than producing a spectacular first answer.

That is why M4’s goal interests me more than its parameter record. I use agents every day, and the difference between an impressive demo and a useful working tool appears when a job grows to many steps. Does the model finish? Does it notice a failed test? Does it preserve decisions made at the beginning? How often does a human have to pull it back on course?

MiniMax has already pushed hard in this direction with earlier models. M3 paired a 1 million-token context window with AI coding, while M4 raises the ambition to engineering work that can continue for hours. That is a clear direction, but duration alone is not quality. An agent can also spend three hours digging a very impressive hole in the wrong place.

What does a 1 million-token context window provide?

A 1 million-token context window can hold large amounts of code, documentation, logs and conversation history in one working session. MiniMax lists 1 million tokens as M4’s maximum context, the same published maximum as M3 and M3.1 Flash.

That does not mean you should dump an entire repository into every request. Long prompts cost more, take time and can make the one detail that matters harder to retrieve. Good agent design still means selecting relevant context, setting clear checkpoints and letting tests decide whether the work is correct.

The real benefit appears when the task genuinely needs its history. An agent can retain architectural decisions, errors it has already investigated and requirements that would otherwise fall out of working memory. Context length alone is therefore not a reason to choose M4 over M3.1 Flash. M4 has to show that it uses the available space better during difficult, long-running work.

How can developers access MiniMax M4?

MiniMax M4 is available through the MiniMax API, M Plan and paid MiniMax Code plans. The API provides an Anthropic-compatible base URL at https://api.minimax.io/anthropic and an OpenAI-compatible base URL at https://api.minimax.io/v1. The model name for requests is MiniMax-M4.

That compatibility is useful because an existing tool can often connect with relatively small changes to its base URL and model name. The Anthropic format uses output_config.effort, while the OpenAI-compatible format uses reasoning_effort. Available levels are low, medium, high, xhigh and max.

The maximum reasoning effort is used by default when the field is omitted. Thinking cannot be disabled completely. The documentation says that sending thinking: {"type": "disabled"} or effort: "none" returns HTTP 400 with the message model "MiniMax-M4" requires adaptive thinking. Lowering the effort level is the supported way to reduce latency and token use.

How much does MiniMax M4 cost?

MiniMax prices M4 at $0.80 per million input tokens, $3.10 per million output tokens and $0.05 per million tokens read from prompt cache. Those are the international API prices listed by MiniMax as of December 3, 2026.

M3.1 Flash costs $0.15 for input, $0.60 for output and $0.015 for cache reads per million tokens. M4 is therefore about 5.3 times more expensive on input and 5.2 times more expensive on output. That is not outrageous beside many heavyweight flagship models, but the gap from MiniMax’s own Flash option is large enough to make model routing matter.

A job that consumes 5 million input tokens and 1 million output tokens would cost $7.10 with M4 before any other charges. The same token volumes would cost $1.35 with M3.1 Flash. If M4 completes the job once while Flash needs six attempts, M4 could still be cheaper. If both produce the same approved result, the arithmetic is not exactly mysterious.

Cache pricing also matters when an agent works with the same large codebase for a long time. Reading 1 million tokens from M4’s prompt cache costs $0.05, compared with $0.80 if that volume is billed as fresh input. A stable prompt structure and reuse of unchanged context can therefore alter the total cost substantially.

That does not mean every client can cache a million tokens throughout a session. The implementation has to hit MiniMax’s cache, and content that is constantly reordered or changed may produce less useful cache reuse. Watch the billed input and cache-read figures in actual usage. A cost estimate based on the cache hit rate you hope to get is just wishful thinking until the logs agree.

This is why I would measure cost per approved task rather than price per token alone. Include retries, human interventions, runtime and the cleanup still required after the agent stops. Only then does MiniMax’s claim of near-Flash inference efficiency acquire practical meaning.

Infographic comparing MiniMax M4 and M3.1 Flash API token prices
M4 costs roughly five times more per token than M3.1 Flash, so the useful comparison is total cost per approved task.

Is MiniMax M4 really an open-weight model?

MiniMax calls M4 an open-weight model, but the weights have not been published yet. The documentation says only that they will follow. There is currently no stated release date, license or download size that would allow a serious assessment of local deployment.

That distinction matters. API access lets developers use a model, but the provider controls its price, availability and service terms. Published weights also make it possible to run the model through other providers, inspect it more closely and build systems that are not tied to one endpoint. Until the files and license are actually available, M4 is an API model with promised open weights.

I like the direction. Early open model releases have made an enormous difference to AI development, and more strong alternatives give developers real choices. MiniMax is also a Chinese company. Before connecting a real repository, review the data-processing terms, contracts and exactly where proprietary code will be sent. Skepticism and interest can live quite comfortably in the same head.

Should you choose M4 or M3.1 Flash?

Use M4 as a candidate when a task requires long planning, many tool calls and work across a large codebase. Start with M3.1 Flash for simpler, repetitive jobs where price and speed matter more than maximum capacity. That is a testable division of labor, not a universal ranking.

Compare them on the same job, with the same tools and the same approval criteria. Measure whether the model completes the task, how often it stops, how frequently a human has to intervene and what the finished result costs. Do not change the model, prompt, agent framework and test set at the same time and then call the difference a model victory.

If you already have an inexpensive workflow that works, 3 trillion parameters are no reason to tear it apart. But if your agent loses the plan in large repositories or needs frequent rescue during long tasks, M4 is a relevant candidate today. The API is ready. The big open-weight release begins only when the weights can actually be downloaded.

Frequently asked questions

Can MiniMax M4 be used with the OpenAI SDK?

Yes. MiniMax provides an OpenAI-compatible endpoint at https://api.minimax.io/v1. Use MiniMax-M4 as the model name and reasoning_effort to control thinking depth. MiniMax also offers an Anthropic-compatible endpoint, where the effort field has a different name.

Can MiniMax M4 run locally today?

No, not from the publicly documented December 3, 2026 release. MiniMax says the model weights will follow, but it has not published a date, license or hardware requirements. The available routes are currently the API, M Plan and paid MiniMax Code plans.

Is MiniMax M4 cheaper than M3.1 Flash?

No. M4 costs $0.80 for input and $3.10 for output per million tokens, while M3.1 Flash costs $0.15 and $0.60. M4 is roughly five times more expensive per token, so it needs to save retries or human work to justify the difference.

Can reasoning be turned off in MiniMax M4?

No. Adaptive thinking is always active. You can select low, medium, high, xhigh or max, but effort: "none" and attempts to disable thinking return an error. Choose a lower effort level to reduce latency and token use.