Send short, well-specified coding tasks to minimax-m3.1-flash at reasoning_effort low first, and pass only the ones that fail your tests to minimax-m4. On AIHubMix's 10 single-file Python tasks, Flash at low passed 19 of 20 runs, against 18 for M4 at low and 19 at max, for about a tenth of what M4 at low cost per task. Start terminal-heavy and multi-step agent work on M4: Vals.ai's independent runs at max effort put it about 20 points ahead of Flash on Terminal-Bench 4.0 and Vibe Code Bench, at 2.8 to 5 times Flash's cost per test.
MiniMax suggests raising Flash's effort before switching models. On the short tasks that didn't help: Flash at max passed 17 of 20, at 4.8 times the cost of Flash at low. The pattern below therefore sends Flash's failures straight to M4; on harder tasks that middle step is untested.
AIHubMix measured the short tasks on December 3, 2026, from 15:18 to 15:30 UTC. With 20 runs per setting, that set separates the models on cost but is too small to rank them on quality. The harder-task figures are Vals.ai's, with both models at max effort, as listed on December 4, 2026. Vals doesn't publish run dates, but Flash's Terminal-Bench score already appeared in its October 2026 launch note, so the two models were run weeks apart. The routing below also draws on MiniMax's model pairing guide, which is the vendor's own positioning, written for its MiniMax Code app.
Which coding tasks start on Flash, and which on M4?
| Task | Start on | Basis |
|---|---|---|
| Single-file edit, clear spec | Flash, low | AIHubMix test |
| Implementing a settled plan | Flash, medium or high | MiniMax guide |
| Terminal-heavy agent work | M4, max | Vals.ai |
| Web app built end to end | M4, max | Vals.ai |
| Design, hard bugs, review | M4, high or max | MiniMax guide |
| Difficulty unknown | Flash first, then M4 | MiniMax guide |
Only the first row comes from AIHubMix's own measurement, and the two Vals.ai rows rest on the benchmark scores further down. The MiniMax rows follow its guide, which calls M3.1 Flash "your everyday workhorse", gives M4 "design, hard debugging, pre-commit review", and says to "raise the reasoning level first, then bring in the M4 advisor, and only then switch models." Its own escalation example starts Flash at medium, not low. The advisor is a feature of MiniMax Code, which AIHubMix doesn't serve; through the API, escalating means a second call to M4. The guide also puts batch and scheduled jobs on Flash at low or medium, the workloads where the tenfold gap in cost per task, measured here at low, adds up fastest.
How do you run Flash first and escalate to M4?
Send each task to Flash at low, check the answer with your own tests, and pass only the failures to M4 with the failing output attached. The pattern is built from MiniMax's escalation advice and the results in this post; AIHubMix hasn't benchmarked it as a pipeline. Both models take the same AIHubMix key and base URL; get a key from the AIHubMix quick start and set it as AIHUBMIX_API_KEY.
import os from openai import OpenAI client = OpenAI(base_url="https://aihubmix.com/v1", api_key=os.environ["AIHUBMIX_API_KEY"]) def ask(model, effort, messages): resp = client.chat.completions.create( model=model, reasoning_effort=effort, max_completion_tokens=32000, messages=messages, ) return resp.choices[0].message.content def solve(task, run_tests): messages = [{"role": "user", "content": task}] answer = ask("minimax-m3.1-flash", "low", messages) passed, report = run_tests(answer) if passed: return "minimax-m3.1-flash", answer messages += [ {"role": "assistant", "content": answer}, {"role": "user", "content": "The tests failed:\n" + report + "\nFix the code."}, ] return "minimax-m4", ask("minimax-m4", "max", messages) run_tests is your own function: it runs the task's tests on the returned code and returns whether they passed, plus their output. solve returns the model that produced the final answer, so you can log how often tasks escalate.
Both calls set effort because MiniMax's docs say both models run at max when it's left out; in AIHubMix's test, max cost 4.8 times low on Flash and 3.1 times low on M4. The M4 step uses max because that is the setting Vals.ai measured, and MiniMax's technical report shows effort paying off on its internal coding set (vendor-reported), where M4 scored 32.0 at low and 50.3 at max, using 1.5 times the output tokens. Thinking counts toward max_completion_tokens; 32,000 matched AIHubMix's test, where no call reached it, and long agent builds at max need more.
What did the 10 short tasks show?
Every setting got the same prompt and the same 10 self-contained Python tasks with hidden tests, from merging intervals to an arithmetic parser written without eval. Each task ran twice through AIHubMix Chat Completions.
| Setting | Passed | Output tokens | Median time | Cost per 1,000 tasks |
|---|---|---|---|---|
| M3.1 Flash, low | 19/20 | 673 | 7.2 s | $0.45 |
| M3.1 Flash, max | 17/20 | 3,529 | 20.9 s | $2.16 |
| M4, low | 18/20 | 1,456 | 10.9 s | $4.62 |
| M4, max | 19/20 | 4,600 | 27.4 s | $14.37 |
Output tokens are the mean per call, thinking included. Cost is at MiniMax's official list prices, with the cached input each call reported. A run passed when the returned code and the hidden tests ran without error within 10 seconds in a sandbox with no network. max_completion_tokens was 32,000, and no call reached it.
All four settings passed 17 to 19 of 20 runs, and with two runs per task a gap of one or two passes is within run-to-run noise. Flash at low missed one run of the arithmetic parser, M4 at low missed the CSV and SemVer tasks once each, and M4 at max missed the Roman numeral task once.
Raising Flash to max didn't help in this set. It failed the arithmetic parser in both runs, after 13,661 and 18,866 output tokens, and the diff task once.
Cost is where the two models separate. M4 at low cost 10.2 times as much per task as Flash at low: it wrote about twice the output tokens (1,456 against 673) and pays about five times as much for each one. Flash at low was also the fastest setting, with a 7.2-second median against 10.9 seconds for M4 at low.
How far ahead is M4 on long agent benchmarks?
By 10 to 20 points, depending on the measure. Vals.ai ran both models at max effort, with MiniMax as the provider, on benchmarks built from long tasks. In Vals' descriptions, Terminal-Bench 4.0 has an agent finish long, realistic pieces of work in a sandboxed terminal, about three quarters of them outside traditional software engineering, and Vibe Code Bench has it build web applications from scratch. These scores come from Vals' pages for M4 and M3.1 Flash:
| Measure | M4 | M3.1 Flash | Gap |
|---|---|---|---|
| Terminal-Bench 4.0 | 44.95% | 25.25% | 19.7 pts |
| Vibe Code Bench v1.1.1 | 76.43% | 57.27% | 19.2 pts |
| Vals Index v2.2 | 61.65% | 51.75% | 9.9 pts |
| Cost per Terminal-Bench test | $3.65 | $0.73 | 5.0x |
| Cost per Vibe Code Bench test | $3.22 | $1.15 | 2.8x |
| Cost per Vals Index test | $2.35 | $0.66 | 3.6x |
Vals.ai figures as listed on December 4, 2026; the Vals Index is version 2.2, updated December 3, 2026. Vals notes that some benchmarks may use a different provider and parameters. Terminal-Bench margins are ±4.91 points for M4 and ±4.32 for Flash. Vals lists no Code Migration score for Flash, though its index costs include Code Migration, so the two index rows may not cover the same tasks.
The Terminal-Bench gap is about four times the larger margin. It also shows the limit of a cheap first attempt: Flash solved about a quarter of those tasks, and M4 a little under half. On the index, Vals ranks M4 15th and Flash 32nd of 45 models.
On the index, Flash used about 18% more tokens per test than M4, part of the reason M4's premium shrinks from about five times on list price to 3.6 times per test there. Flash also finished an index test faster on average, in 43 minutes 18 seconds against an hour for M4. Vals' model pages show MiniMax's list prices; these costs are Vals' figures, not AIHubMix's.
What does a task cost on each model?
The multiple per task depends on how many tokens each model spends, so across the measurements in this post it runs from 2.8 on Vibe Code Bench to 10.2 on the short tasks at low:
| Measure | M3.1 Flash | M4 | M4 ÷ Flash |
|---|---|---|---|
| Input, per 1M tokens | $0.15 | $0.80 | 5.3x |
| Output, per 1M tokens | $0.60 | $3.10 | 5.2x |
| Cache read, per 1M tokens | $0.015 | $0.05 | 3.3x |
| Short tasks at low, per 1,000 | $0.45 | $4.62 | 10.2x |
| Short tasks at max, per 1,000 | $2.16 | $14.37 | 6.7x |
| Vals Index at max, per test | $0.66 | $2.35 | 3.6x |
List prices in USD from MiniMax's pricing page, accessed December 3, 2026 at 14:32 UTC. The short-task rows are AIHubMix's test; the last row is Vals.ai's.
For routine work the absolute amounts stay small: a thousand short tasks on M4 at max cost about $14. The multiple matters at volume, and in agent sessions that resend a long context on every step, where M4's cache read price is 3.3 times Flash's. AIHubMix's compare page for the two models puts them side by side.
What does switching models mid-session cost?
For a single-turn task, almost nothing: the prompts in AIHubMix's test were 352 to 446 tokens. In an agent session the switch can be the most expensive step. MiniMax's pairing guide says "the cache is bound to the model and the reasoning level", so after a switch "the first step has to recompute the full context". The guide describes MiniMax Code, and AIHubMix hasn't tested whether changing the model or the effort level clears the cache on the API. To see what happens on your own traffic, check prompt_tokens_details.cached_tokens in the usage of the first call after a switch.
As an estimate at list prices: with 100,000 tokens of context, the first M4 call after a switch pays $0.08 for that context at the input price, where a cache read would cost $0.005. That is why the guide says to switch once per stage, at a stage boundary, and to avoid moving back and forth inside one task. By the guide's account, changing Flash's effort level mid-session triggers the same recompute.
When should a task skip Flash and start on M4?
Start on M4 when a failed first attempt is likely. On Terminal-Bench 4.0, Flash solved about a quarter of tasks in Vals' runs even at max effort, so a Flash-first pipeline would pay for two attempts on most tasks of that kind and wait for both. The work MiniMax's guide gives to M4 belongs here too: design trade-offs, hard bugs and pre-commit review.
Start on M4 when nothing checks the result. Escalation depends on catching the failure, and where no test or check covers the answer, a wrong Flash answer goes through unnoticed.
In a long agent session, pick the model at the start, since a switch midway re-reads the whole context. If M4 is needed partway through, MiniMax's guide suggests having the current model write a short handoff brief and starting a new session with it.
What hasn't been tested?
AIHubMix's test ran 10 single-file tasks, twice each, at low and max only. It didn't try medium or high, which MiniMax's guide recommends for everyday Flash work, and it had no multi-file changes, tool use or long agent runs. Vals.ai ran both models at max only, so its gap says nothing about M4 at low against Flash at low, and its Flash page lists no SWE-bench Multimodal or Code Migration score. MiniMax's technical report leaves M3.1 Flash out of its comparison table, so there is no vendor-reported head-to-head. The escalation pattern above hasn't been benchmarked as a pipeline, and the cache rule on switching comes from MiniMax's description of its own app and is untested on the API.
Keep reading: the MiniMax M4 series
- To see the same 10 tasks with M3 included, and the full test method: MiniMax M4 vs M3 on 10 Coding Tasks: At Low Effort, Same Passes for 25% Less
- Before you send escalated tasks to M4, the request settings that fail or return empty replies on it, with raw errors and a verification test, are in MiniMax M3 to M4 Migration: Error 2013, Empty Replies and the Parameters to Change
- For terminal-heavy agent work, where Vals.ai scores Kimi K3.1 Pro above M4, the head-to-head is in MiniMax M4 vs Kimi K3.1 Pro: Kimi for Terminal Agents, M4 for App Building at Under Half the Cost
Sources
- MiniMax pricing: official list prices for M4 and M3.1 Flash, accessed 2026-12-03 14:32 UTC
- MiniMax model pairing guide: MiniMax's split between M4 and M3.1 Flash, its escalation order and the cache rule on switching, written for MiniMax Code, accessed 2026-12-04
- Vals.ai Vals Index leaderboard, Terminal-Bench 4.0, Vibe Code Bench v1.1.1, MiniMax-M4 and MiniMax-M3.1-Flash: independent scores, cost per test and benchmark descriptions, both models at max effort, accessed 2026-12-04; run dates not published
- MiniMax M4 technical report: M4's results by effort level, vendor-reported; M3.1 Flash is not in its comparison table, accessed 2026-12-04
- AIHubMix compare page and model pages for minimax-m4 and minimax-m3.1-flash: model IDs; AIHubMix's coding-task test ran through AIHubMix Chat Completions on 2026-12-03, 15:18 to 15:30 UTC


