Task shortlist
Cheapest AI models for coding
Coding agents send long prompts, call tools and retry after failed edits, so the cheapest input price is not the same as the cheapest completed task. This shortlist filters for paid models with at least a 128K context window, tool support and a reasonable capability score, then ranks them by capability per dollar.
- Models in shortlist
- 10
- Lowest task-weighted price
- $0.098
- Lowest input price
- $0.030
- Highest capability
- 53.9
The short answer
The first row is DeepSeek DeepSeek V4.1 Flash 1017, at $0.098 per million task-weighted tokens and a value score of 332.7. The strongest model in the filtered list is Google Gemini 4 Hydrogen with a capability index of 53.9. Price and capability are not the same thing; use the table to choose a shortlist, then test it on your own examples.
Models ranked for this task
Task-weighted price uses 60% input and 40% output. The last column is a fixed reference workload of 1M input plus 250K output tokens per month, shown for comparison across pages.
| Model | Input / 1M | Output / 1M | Context | Capability | Task-weighted price | 1M + 250K monthly |
|---|---|---|---|---|---|---|
| DeepSeek V4.1 Flash 1017DeepSeek | $0.030 | $0.200 | 1.0M | 32.6value 332.7 | $0.098 | $0.080 |
| Claude Haiku 5.5Anthropic | $0.100 | $0.500 | 1M | 36.5value 140.4 | $0.260 | $0.225 |
| Muse EmberMeta | $0.100 | $0.500 | 1.0M | 36value 138.5 | $0.260 | $0.225 |
| GLM 5.3Z.ai | $0.070 | $1.40 | 1.0M | 31.7value 52.7 | $0.602 | $0.420 |
| Hy4Tencent | $0.417 | $1.25 | 1.0M | 34.6value 46.1 | $0.750 | $0.730 |
| GPT-6.1 TerraOpenAI | $1.00 | $5.00 | 1.1M | 51.3value 19.7 | $2.60 | $2.25 |
| Qwen4 MaxAlibaba Qwen | $1.43 | $4.28 | 1M | 42.9value 16.7 | $2.57 | $2.49 |
| Muse Spark 1.3Meta | $1.25 | $4.25 | 1.0M | 36.6value 14.9 | $2.45 | $2.31 |
| Gemini 3.8 FlashGoogle | $0.825 | $4.13 | 1.0M | 30.8value 14.4 | $2.15 | $1.86 |
| Gemini 4 HydrogenGoogle | $1.50 | $7.50 | 1.0M | 53.9value 13.8 | $3.90 | $3.38 |
What matters for this task
- Tool use and structured output matter more than raw token price for agent loops.
- Output tokens are often the largest line item when the model writes or rewrites files.
- A 128K context window is enough for many repositories, but not for whole-monorepo prompts.
- Retries matter. A model that fails an edit twice can cost more than a slightly pricier model.
What the table does not tell you
- The capability score is a general index, not a coding benchmark.
- Batch prices are excluded because they require asynchronous submission.
- Test the shortlist on your own repository before committing to a production model.
Other task shortlists
Questions
What is the cheapest model for coding?
The table ranks models by capability per dollar, not by the lowest input price. The lowest-cost option that still supports tools and a 128K context is the practical starting point.
Should I use a batch model for coding?
Batch pricing is usually cheaper, but batch jobs are asynchronous and unsuitable for interactive coding. This page excludes batch entries so the comparison matches normal agent use.
Is a higher intelligence score always better?
No. It is a general capability signal from the public dataset. Latency, tool reliability, output style and language support can matter more for a specific repository.
Prices come from the public model feed and are shown as a recorded snapshot. Confirm the current rate and usage terms on the vendor page before committing to a large workload.