Best AI for coding in 2026: we tested 27 models on the same jobs
We gave 27 AI models the same three secret coding jobs. 15 passed every check, so price and speed decided. The cheapest that passed everything was Claude Haiku 5.5, at about 0.19 cents per job; the fastest was GPT-6.1 Sol on ultrafast.
Which is the best AI for coding? We gave 27 AI models the same three secret coding jobs and checked every answer with hidden tests. 15 of the 27 passed every check. So on our jobs, the best AI for coding came down to price and speed. The cheapest model that passed everything was Claude Haiku 5.5, at about 0.19 cents per job.
How we tested
Each of the 27 ranked models got the same three jobs:
- Fix the money maths in a small program.
- Write a program that splits a bill between people.
- Write a CSV reader. A CSV file stores rows of data, with commas between the values.
Each job ran three times, so each model had nine runs. One round of the three jobs has 62 hidden checks: small tests that the AI never sees. Three rounds give 186 check results. Our methods page explains the jobs and the checks.
We sent the jobs through the API, the connection programmers use from their own software. Most models ran through OpenRouter, a paid service that gives access to many models; the cost is what OpenRouter charged. GPT-6.1 Sol and GPT-6.1 Terra ran through OpenAI's own API; there we worked out the cost from the token counts at OpenAI's list price. A token is a small piece of text that AI companies count and bill.
The full ranking
Here are all 27 models. Models that passed every check come first, ordered by cost per job. Then come the models that missed some checks, ordered by how many they passed.
| Model | Maker | Checks passed | Cost per job (US cents) | Middle time | Last test day (2026) |
|---|---|---|---|---|---|
| Claude Haiku 5.5 | Anthropic | 186/186 | 0.19 | 15 s | 8 Oct |
| GPT-6.1 Terra | OpenAI | 186/186 | 0.93 | 21 s | 27 Oct |
| GPT-6.1 Sol | OpenAI | 186/186 | 1.3 | 22 s | 9 Oct |
| Gemini 4 Argon | 186/186 | 1.4 | 24 s | 17 Oct | |
| Claude Sonnet 5.5 | Anthropic | 186/186 | 2.6 | 17 s | 7 Oct |
| Muse Spark Open | Meta | 186/186 | 5.0 | 93 s | 17 Oct |
| Claude Opus 5.5 | Anthropic | 186/186 | 5.9 | 30 s | 7 Oct |
| Gemini 4 Hydrogen | 186/186 | 7.6 | 69 s | 12 Nov | |
| Muse Wonder | Meta | 186/186 | 8.0 | 31 s | 17 Oct |
| Gemini 3.8 Flash | 186/186 | 8.5 | 147 s | 10 Oct | |
| Claude Fable 5.1 | Anthropic | 186/186 | 14.2 | 32 s | 7 Oct |
| Gemini 4 Carbon | 186/186 | 14.9 | 172 s | 12 Nov | |
| Gemini 3.1 Pro (preview) | 186/186 | 16.4 | 100 s | 10 Oct | |
| Claude Fable 5.2 | Anthropic | 186/186 | 22.2 | 48 s | 13 Nov |
| Gemini 4 Neon | 186/186 | 23.1 | 123 s | 27 Nov | |
| GLM-5.3 FlashX | Z.ai | 185/186 | 1.9 | 62 s | 9 Oct |
| Muse Spark 1.3 | Meta | 185/186 | 4.3 | 83 s | 17 Oct |
| GPT-6 Luna | OpenAI | 184/186 | 0.12 | 25 s | 8 Oct |
| GLM-5.3 Flash | Z.ai | 184/186 | 0.69 | 180 s | 7 Oct |
| GLM-5.3 Prime | Z.ai | 184/186 | 29.4 | 365 s | 9 Oct |
| Grok 4.7 | xAI | 182/186 | 9.5 | 153 s | 10 Oct |
| GLM-5.3 | Z.ai | 182/186 | 11.0 | 184 s | 7 Oct |
| Mistral Large 4 | Mistral | 181/186 | 1.6 | 22 s | 7 Oct |
| DeepSeek V4 Pro | DeepSeek | 180/186 | 1.4 | 271 s | 7 Oct |
| MiniMax M3 | MiniMax | 178/186 | 2.3 | 116 s | 21 Oct |
| MiniMax M3.1 Flash (free) | MiniMax | 175/186 | free | 215 s | 21 Oct |
| Claude Haiku 4.5 | Anthropic | 157/186 | 0.81 | 7 s | 7 Oct |
Cost per job is the average of nine runs, at the prices on the days we ran the tests. Middle time is the middle value when we put the nine runs in order. Click a model's name for a related article of ours. We left out Qwen 3.8. It ran only two of the three jobs, so its numbers do not fit this table.
Most of the 12 models that missed checks came close: nine of them passed 180 or more of 186. The lowest score was 157, for Claude Haiku 4.5, the older small Claude model.
Cheapest AI for coding
If you pay per use, cost per job matters most. In our API test, these were the five cheapest models that passed every check:
- Claude Haiku 5.5: about 0.19 cents per job.
- GPT-6.1 Terra: about 0.93 cents.
- GPT-6.1 Sol: about 1.3 cents.
- Gemini 4 Argon: about 1.4 cents.
- Claude Sonnet 5.5: about 2.6 cents.
The most expensive model that passed everything, Gemini 4 Neon, cost about 23.1 cents per job, more than 100 times as much as Claude Haiku 5.5. Among the 15 models that passed every check, paying more did not get a better score.
GPT-6 Luna was even cheaper, at 0.12 cents, but it passed 184 of 186. MiniMax M3.1 Flash was free through OpenRouter when we tested it. It passed 175 of 186. Its middle time was about 3 minutes and 35 seconds per job.
Prices change. Our Gemini costs are what OpenRouter charged on the test day. Google's own Gemini API doubles the standard input and output prices of Gemini 4 Argon and Carbon on 1 December 2026. See our price comparison for the current list prices.
Fastest AI for coding
GPT-6.1 Sol has a speed setting. On "ultrafast", it finished a job in about 6 seconds (middle value) and still passed every check. But it cost about 7.8 cents per job, about six times as much as on its normal setting. Our ultrafast test explains the settings.
Without a special setting, the fastest models that passed everything were Claude Haiku 5.5 (about 15 seconds) and Claude Sonnet 5.5 (17). GPT-6.1 Terra took 21 seconds and GPT-6.1 Sol 22. GPT-6.1 Terra also has an effort setting. On the "low" effort setting, Terra took about 12 seconds per job, cost 0.51 cents and still passed every check.
Some models were much slower. Gemini 4 Carbon took about 172 seconds per job, and GLM-5.3 Prime about 365. We tested these models on different days.
Best AI for coding from each maker
If you already use one company's tools, this is the cheapest model from each maker that passed every check:
- Anthropic: Claude Haiku 5.5, about 0.19 cents per job. Claude Sonnet 5.5 (2.6 cents) and Opus 5.5 (5.9 cents) also passed everything.
- OpenAI: GPT-6.1 Terra, about 0.93 cents on its normal setting and 0.51 cents on low effort. GPT-6.1 Sol also passed everything.
- Google: Gemini 4 Argon, about 1.4 cents through OpenRouter in October. Google's own standard API prices for Argon double on 1 December.
- Meta: Muse Spark Open, about 5.0 cents.
From xAI, DeepSeek, Mistral, MiniMax and Z.ai, none of the models we tested passed all 186 checks. Most came close.
Is Claude or ChatGPT better for coding?
On our jobs, neither was clearly better. Through the API, every Claude and OpenAI model we tested passed all 186 check results, except Claude Haiku 4.5 (157) and GPT-6 Luna (184). The cheapest that passed everything was a Claude model, Haiku 5.5. The fastest setup was an OpenAI one, Sol on ultrafast.
Many people use the apps instead of the API. On 27 November 2026 we gave the paid Claude, ChatGPT and Gemini apps the same three coding jobs. All three passed all 62 hidden checks. ChatGPT's middle time over the three jobs was about 9 seconds, on the Instant setting our account had selected. For both Claude and Gemini, it was at least 28 seconds. For one job in each of those two apps, we only had an upper limit.
What about coding tools?
Coding tools such as Claude Code, Codex and Cursor work inside your project. They can read your files and run commands. We tested some of them with the same kind of jobs:
- Codex vs Claude Code: both did equally well. Claude Code was about three times faster; Codex cost less than half as much for developers.
- Cursor vs Claude Code: with the same model, both passed every secret check in about the same time. Claude Code read about 2.9 times as much text per job.
- OpenCode vs Claude Code: with the same model, both passed every secret check, but OpenCode read about one fifth as much text as Claude Code.
- GitHub Copilot Free: with Copilot in the terminal (the Copilot CLI, where you type commands), it passed all its hidden checks in our test.
In those tests, the tools differed mostly in speed, in how much text they read, and in cost.
Which AI should you use for coding?
- You want the lowest cost and every check passed (API test): Claude Haiku 5.5, about 0.19 cents per job.
- You want speed (API test): GPT-6.1 Sol on ultrafast, about 6 seconds per job, if the higher cost is fine.
- You want low cost and quick answers: GPT-6.1 Terra on low effort, about 0.51 cents and 12 seconds per job.
- You use Google: Gemini 4 Argon passed everything for about 1.4 cents through OpenRouter. Google's own standard prices for it double on 1 December.
- You want something free (when we tested it): MiniMax M3.1 Flash was free through OpenRouter, but it was slow and passed 175 of 186.
- You work on big, hard projects: our jobs are small, so this test cannot tell you which model is best there. Try a few on your own work and compare the cost.
Questions people ask
Is Claude or ChatGPT better for coding?
On our coding test, neither was clearly better. Through the API, every Claude and OpenAI model we tested passed all 186 check results, except Claude Haiku 4.5 (157) and GPT-6 Luna (184). The cheapest that passed everything was Claude Haiku 5.5, at about 0.19 cents per job; GPT-6.1 Sol cost about 1.3 cents. In the paid apps, Claude and ChatGPT both passed all 62 checks. ChatGPT had the lower middle time on the coding jobs, on the Instant setting our account had selected.
What's the best OpenAI model for coding?
Of the OpenAI models we tested, GPT-6.1 Terra and GPT-6.1 Sol passed all 186 check results. Terra was the cheaper of the two. On its normal setting it cost about 0.93 cents per job. On low effort it cost 0.51 cents and still passed every check. Sol on its ultrafast setting was the fastest setup in our test, about 6 seconds per job, but cost about 7.8 cents. GPT-6 Luna cost only 0.12 cents but passed 184 of 186.
What is the #1 AI right now?
There is no single number one in our test. 15 of the 27 models we ranked passed every check on our coding jobs, so price and speed decide. The cheapest of those was Claude Haiku 5.5, at about 0.19 cents per job. Our jobs are small; for big projects the order may differ.
How we checked
We took every result from our own test runs between 6 October and 27 November 2026. Each model had nine runs: three jobs, three tries each, with one request per run. We graded every answer with the same 62 hidden checks per round. The cost per job is the average of the nine runs. The time is the middle value.
Most models ran through OpenRouter, at the prices on the days we ran the tests. We sent one message per request and left the model settings at their defaults. GPT-6.1 Sol and Terra ran through OpenAI's own API; their cost is worked out from the token counts at OpenAI's list price. There we used the model's own default, except where we name a setting: Sol's fast and ultrafast speed settings and Terra's low effort. GPT-6 Luna ran through OpenRouter.
These are small, clear jobs, so many models pass them all. Your results on big projects may differ. Models and prices change, so check the date column. The charts are our own, and none of the images was made by AI.