MiniMax M4 Was 8x Cheaper Than Amazon Ergo for the Same Code

Three coding models arrived within ten days: MiniMax M4 on December 3, 2026, Amazon Ergo on December 1, and GLM-5.4 on November 23. By M4’s launch, both newer models had overtaken GLM on ModelDial’s overall coding score. We wanted to know whether paying for the higher-scoring model would buy a better fix, or just a more expensive passing test.
All three fixed a bug that made an old reading look live: unplug a thermometer and the app kept displaying 24°C. They also wrote maze solvers. Given two 28-move paths, every solver picked the one with nine turns instead of thirteen. Ergo’s solver cost $0.03914 to generate; M4’s cost $0.00376. Across both tasks, Ergo cost about 8 times as much as M4 for the same passing results, and GLM-5.4 matched both.
MiniMax M4, Amazon Ergo or GLM-5.4: which coding model fits your project?
- MiniMax M4 led ModelDial’s frontend benchmark at 80.3/100. For the two working JavaScript functions we actually bought, M4 cost $0.00543 combined.
- Amazon Ergo led the backend benchmark at 52.0/100. Its maze solver passed every layout, but so did the other two. The higher generation cost bought no extra correct routes in this set.
- GLM-5.4 finished last overall on ModelDial, yet its code passed every check here. If you already have the GLM Coding Plan, these are two jobs you can try there; its measured usage would cost $0.00353 at AI/ML API rates.
Coding benchmarks: MiniMax M4 leads on frontend, Amazon Ergo on backend
On ModelDial’s coding benchmark, M4 scored 56.2 overall, Ergo 53.9 and GLM-5.4 48.0. All three used their own maximum reasoning setting. The overall score is useful for a first look; the frontend and backend rows give different answers about which model to try.
| Score out of 100 | MiniMax M4 | Amazon Ergo 1.0 | GLM-5.4 |
|---|---|---|---|
| Overall | 56.2 | 53.9 | 48.0 |
| Frontend engineering | 80.3 | 71.9 | 56.7 |
| Backend engineering | 47.8 | 52.0 | 45.9 |
| Autonomous delivery | 58.6 | 56.9 | 54.3 |
| Visual aesthetics | 33.0 | 31.0 | 26.0 |
| Maintainability | 57.0 | 51.0 | 51.0 |
Source: ModelDial Radar, checked December 3, 2026; CC BY 4.0. Selected scores out of 100, unchanged. “Max” is each provider’s setting, not a common token budget.
M4’s frontend lead over GLM was 23.6 points. For a database-backed dashboard, though, the more useful comparison is what reached the screen. In LeanZero’s Gauntlet 7.2 payment dashboard test, Ergo and GLM both calculated all 384 payment buckets correctly. Only Ergo passed the check that the 3D surface displayed the data, and even it missed the check that a selection carried across views. There was no M4 entry in those two runs. That distinction shaped our test: check the value returned by the code, then look at what a person can actually read.
What the labs reported at launch
| Model | Published result | What the result covers |
|---|---|---|
| MiniMax M4 | 40.0 on ProgramBench; 44.0 on SWE-Marathon v1.2 | Building programs and completing extended software tasks. MiniMax evaluated ProgramBench internally with OpenCode v2.2.7 and reports max effort for M4. |
| Amazon Ergo | 74.2 on DeepSWE (pass@1); 23.5 on ProgramBench (“almost resolved”) | Fixing existing repositories and rebuilding programs. A first-attempt repository fix is a different test from reconstructing a program. |
| GLM-5.4 | 51.1% wins, 25.7% ties and 23.1% losses against GLM-5.3 | Z.ai’s comparison with its predecessor. Its separate 30B experiment tested the architecture, not the released flagship against M4 or Ergo. |
Sources: MiniMax’s technical report and M4 launch post, Amazon’s Ergo launch evaluation and Z.ai’s GLM-5.4 release documentation. Both MiniMax and Amazon name ProgramBench, but these were separate runs. Both launch tables also include GLM-5.3; its scores don’t belong to GLM-5.4.
JavaScript coding results for MiniMax M4, Amazon Ergo and GLM-5.4
The first job was a bug fix: stop a disconnected thermometer from displaying a stale number. The second was an algorithm: given a map of walls and passages, return the shortest legal path, breaking ties by the number of turns. Each model saw the specification, not the answer key. We ran its JavaScript on the inputs below.
| Our test | MiniMax M4 | Amazon Ergo | GLM-5.4 |
|---|---|---|---|
| Repair the temperature monitor | 10/10 checks | 10/10 checks | 10/10 checks |
| Find the best route on all 1,024 small layouts | 1,024/1,024 | 1,024/1,024 | 1,024/1,024 |
| Solve 300 larger mazes, including 30 sealed exits | 300/300 | 300/300 | 300/300 |
On December 3, 2026, we sent the same task prompt to each model, without tools, and requested low reasoning effort. M4 and Ergo ran through AI/ML API; GLM ran through OpenCode on the GLM Coding Plan. Each function came from one completed response. The visualizations replay recorded outputs offline.
JavaScript debugging: why does an unplugged thermometer still say 24°C?
At noon a thermometer sends a reading of 24°C. A minute later someone unplugs it. The room might still be at 24°C, but the app has no way to know. The bug is the number on the screen: it looks just as current after the disconnect as it did before.
12:01
The thermometer is unplugged.
Its last reading was 24°C at 12:00. Nobody knows the temperature now.
The old code checked whether the new value was truthy. JavaScript treats both null (sensor offline) and 0 (a real temperature) as falsy, so it silently kept the previous reading in both cases. All three models fixed that distinction and passed the remaining checks, including late arrivals and two updates with the same timestamp.
Maze solving: does Amazon Ergo’s backend lead produce a better path?
There are two shortest paths through the first maze. Both reach the exit in 28 moves. One changes direction thirteen times, the other only nine. Try to find the smoother route before revealing what the three programs returned.
Maze challenge
S = start · E = exit · Dark squares are walls
Can you beat the turn trap?
Reach E in the fewest moves. If two routes tie, fewer turns wins. Tap a neighboring square or use the arrow keys.
Start at S in the upper left.
All three solvers found the nine-turn path. Switch to the thirteen-turn alternative to see where it zigzags: counting steps alone would mark both answers correct. The second maze forces a 56-move route with fourteen turns. The third has no exit path; all three reported it as unreachable.
The full set contains 300 distinct 11-by-11 labyrinths, including 30 with sealed exits. We ran the original functions unchanged. For each layout, an independent checker ran a breadth-first search backward from the exit, enumerated the shortest legal paths and compared turn counts. A deliberately worse 28-move solution failed the check for the first maze. The same programs also passed all 1,024 three-by-four layouts. These are local executions of six saved functions across the two tasks, not new model calls per input.
Unzip the folder and run node run.mjs with Node.js 20 or later. The download includes both original prompts, all six model answers, the maze layouts, the sensor cases and the grader. No API key or package install is needed.
MiniMax M4, Amazon Ergo and GLM-5.4 API pricing per million tokens
The AI/ML API catalog lists the following US dollar rates per million text tokens, checked December 3, 2026. The last column prices 100,000 uncached input tokens plus 10,000 output tokens. It’s a fixed workload for comparing rates, not what the tests cost.
| Model ID on AI/ML API | Uncached input | Cached input | Output | Example cost |
|---|---|---|---|---|
minimax/minimax-m4 | $0.80 | $0.05 | $3.10 | $0.1110 |
amazon/ergo-1.0 | $1.058 | $0.03174 | $3.174 | $0.1375 |
zhipu/glm-5.4 | $1.19 | $0.221 | $3.74 | $0.1564 |
What the two working solutions cost
| Model and billing route | Sensor repair | Maze solver | Both tasks |
|---|---|---|---|
| MiniMax M4, charged by AI/ML API | $0.00168 | $0.00376 | $0.00543 |
| Amazon Ergo, charged by AI/ML API | $0.00531 | $0.03914 | $0.04444 |
| GLM-5.4, subscription use at AI/ML API rates | $0.00077 | $0.00276 | $0.00353 |
Totals use unrounded charges, so a total can differ by $0.00001 from the sum of the rounded cells.
The four paid calls in this table settled at $0.049874 in total. Ergo used 12,283 output tokens for its solver, including 11,497 reasoning tokens; M4 used 1,160 output tokens for the same task. The cost is for writing the function once. Running that function on more mazes costs no additional model tokens.
Amazon’s model card describes Ergo’s reasoning as always on. On AI/ML API, reasoning_effort still changes how long it thinks, but even at low effort Ergo spent 11,497 tokens reasoning about the maze.
GLM used 210 input and 140 output tokens for the repair, then 139 input and 693 output for routing, with no cached input on either call. At AI/ML API rates that’s $0.00077350 and $0.00275723, respectively. Neither amount was charged to the API account.
When to choose MiniMax M4 over Amazon Ergo or GLM-5.4
For a frontend-heavy project, I’d start with M4: it led the independent frontend score and was the cheaper of the two models we paid to write these functions. For backend work, Ergo’s benchmark lead makes it worth trying on your own repository. It didn’t solve any maze the cheaper options missed. In a separate Amazon Ergo coding review, it passed 40 of 41 Python checks; its slug function dropped a word that ended exactly at the character limit.
If you have the GLM Coding Plan, start there for a small, testable repair. In our earlier GLM-5.4 vs Claude Opus 5.5 comparison, GLM also fixed a ferry booking rule and a clipped mobile button from the code and a screenshot. Here it tied both newer models on the repair. Ten days was enough to change the benchmark order, but not enough to make that subscription a bad choice for a bug you can reproduce.
To compare them on your own bug, sign in to AI/ML API, create a key, and send the same failing example to each model ID in the pricing table. The MiniMax M4, Amazon Ergo 1.0 and GLM-5.4 pages list each model’s limits and code samples.
FAQ: MiniMax M4, Amazon Ergo and GLM-5.4 for coding
Which is better for frontend coding, MiniMax M4 or Amazon Ergo?
MiniMax M4 leads on ModelDial’s frontend engineering benchmark: 80.3/100 versus 71.9 for Ergo and 56.7 for GLM-5.4. For backend engineering the order changes: Ergo leads at 52.0, ahead of M4 at 47.8.
Can GLM-5.4 read a screenshot of a UI bug?
Yes. Z.ai’s GLM-5.4 API accepts images alongside text and returns text. Send the screenshot with the relevant component code so the model can connect the visible layout problem to a specific element. Amazon Ergo 1.0 accepts text only.
Can I self-host Amazon Ergo 1.0?
Yes. Amazon publishes the weights and lists SGLang and vLLM as serving options. The smallest official Ergo checkpoint is a 626 GB download before runtime memory, so a hosted endpoint is a more practical starting point for most individual developers. MiniMax calls M4 open-weight too, but its GitHub repository says the weights will be released later.
How much context can MiniMax M4, Amazon Ergo and GLM-5.4 handle?
MiniMax M4, Amazon Ergo 1.0 and GLM-5.4 each have a one-million-token context window according to their developers. That is the working context for a request, not the number of tokens the model can write in one response. Amazon and Z.ai both list a separate 128K output limit for Ergo and GLM-5.4.
Which is cheapest per token: MiniMax M4, Amazon Ergo or GLM-5.4?
For uncached input and output on AI/ML API, MiniMax M4 has the lowest rates: $0.80 per million input tokens and $3.10 per million output tokens. Ergo has the cheapest cached input of the three at $0.03174 per million. Which rate matters most depends on how much of your prompt is actually served from cache.
What are the API model IDs for MiniMax M4, Amazon Ergo and GLM-5.4?
On AI/ML API, use minimax/minimax-m4, amazon/ergo-1.0 or zhipu/glm-5.4. MiniMax’s own API uses MiniMax-M4 instead; model IDs are specific to the provider.
Key Takeaways
- MiniMax M4, Amazon Ergo and GLM-5.4 passed every check in our two JavaScript tests: 10/10 on the sensor repair, 1,024/1,024 small maps and 300/300 mazes.
- Ergo cost about 8 times as much as M4 for the same results ($0.0444 vs $0.0054), mostly because it spent 11,497 tokens reasoning about the maze.
- On ModelDial, M4 leads overall (56.2) and on frontend work (80.3), Ergo leads backend engineering (52.0), and GLM-5.4 is last at 48.0.
- On AI/ML API, M4 has the lowest uncached rates ($0.80 input, $3.10 output per million tokens) and Ergo the cheapest cached input ($0.03174).
- Call them on AI/ML API as minimax/minimax-m4, amazon/ergo-1.0 and zhipu/glm-5.4.



