Send short, well-specified coding tasks to M3.1 Flash at low effort: on AIHubMix's 10 single-file Python tasks it 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. Pay M4's roughly fivefold list price for terminal-heavy and multi-step agent work, where Vals.ai's independent runs 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. On short tasks, raising Flash to max effort didn't help in AIHubMix's set (17 of 20 passed, against 19 at low) and cost 4.8 times as much, so the escalation pattern below sends Flash's failures straight to M4; on harder tasks that middle step is untested.
AIHubMix measured the short tasks on December 3, 2026; 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 task split 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 should 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. 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 rather than 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.
Is Flash enough for short, well-specified tasks?
In this set of tasks, yes. 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 on December 3, 2026, between 15:18 and 15:30 UTC.
| 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 the Roman numeral task once.
Raising Flash to max didn't help here. It failed the arithmetic parser in both runs, after 13,661 and 18,866 output tokens, and the diff task once, and it cost 4.8 times as much as Flash at low. MiniMax's docs say both models run at max when effort is left out, so set effort explicitly on every call.
On cost the two models are far apart. 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 harder coding benchmarks?
Far enough to matter for agent work. 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. Vals' pages for M4 and M3.1 Flash put M4 ahead by 10 to 20 points on the three measures below. Per test, M4 cost 5.0 times as much as Flash on Terminal-Bench, 2.8 times on Vibe Code Bench and 3.6 times on the Vals Index leaderboard:
| 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 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 above; 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, and one AIHubMix key calls both.
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. This is a pattern built from MiniMax's escalation advice and the results above; AIHubMix hasn't benchmarked it as a pipeline. Get a key from the AIHubMix quick start.
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. 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, 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 does switching between Flash and M4 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. 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 you 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.
Escalation also depends on catching the failure. Where no test or check covers the result, a wrong Flash answer goes through unnoticed, and M4 from the start is the safer choice.
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 doesn't this evidence cover?
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 cache rule on switching comes from MiniMax's description of its own app and is untested on the API.
FAQ
Is MiniMax M3.1 Flash good enough for coding?
For short, well-specified tasks, yes in AIHubMix's test: 19 of 20 runs passed at low effort, at $0.45 per 1,000 tasks. For terminal-heavy agent work, Vals.ai measured 25.25% on Terminal-Bench 4.0 against M4's 44.95%, both at max.
How much more does M4 cost than M3.1 Flash?
M4's list price is 5.3 times Flash's for input, 5.2 times for output and 3.3 times for cache reads. Per task, M4 cost 10.2 times as much at low on AIHubMix's short tasks. At max in Vals' runs, it cost 5.0 times as much per Terminal-Bench test and 3.6 times per Vals Index test.
Should I raise Flash's effort before switching to M4?
MiniMax's guide says to try that first. In AIHubMix's set it didn't help: Flash at max passed 17 of 20 against 19 at low, at 4.8 times the cost. On harder tasks that step hasn't been tested.
Which effort level should M4 use for escalated tasks?
High or max. Vals.ai measured M4 at max, and MiniMax reports max scoring 18.3 points above low on its internal coding set. On AIHubMix's short tasks, low and max passed 18 and 19 of 20, so M4 at low suits routine work, but a task that has already failed on Flash is past that point.
Do I need to set effort on both models?
Yes. Both models always think, and MiniMax's docs say both default to max when effort is left out. In AIHubMix's test, max cost 4.8 times low on Flash and 3.1 times low on M4.
Does switching models in the middle of a session cost more?
MiniMax says so for its MiniMax Code app: the cache is tied to the model and the effort level, so the first step after a switch re-reads the full context. With 100,000 tokens of context, that step costs $0.08 on M4 instead of $0.005 from cache. AIHubMix hasn't checked this on the API.
Can I call both models with one API key?
Yes, through AIHubMix: minimax-m3.1-flash and minimax-m4 use the same key and the same base URL.
Keep reading: the MiniMax M4 series
- To see the same 10 tasks with M3 included, and the full test method, read MiniMax M4 vs M3: Should You Upgrade, and at Which Effort Level?
- 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: Which API 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: Which One for Coding Agents?
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



