The cheapest LLM for coding agents
Cost ranking for coding agents: 120,000 input tokens and 20,000 output tokens per coding hour, 50% of them cached. Ranked on that shape rather than on headline input price, the cheapest model is GPT-6 Luna at $0.02 per coding hour, which is $1.99 a month at 4 coding hours a day. The spread to the most expensive model on the same workload is 79 times, so the choice is worth ten minutes.
Prices verified December 1, 2026
Why rank on the workload, not the input price
Input prices are the number every provider leads with, but the mix decides the ranking, and here a coding turn resends the repository on every loop. This page applies the task's own token counts and its realistic cache-hit share (50%) before sorting.
The table
| Model | Provider | Tier | Per coding hour | Per month |
|---|---|---|---|---|
| GPT-6 Luna | OpenAI | budget | $0.02 | $1.99 |
| Claude Haiku 5.5 | Anthropic | budget | $0.02 | $1.99 |
| GPT-5.4 nano | OpenAI | budget | $0.04 | $4.58 |
| DeepSeek Flash | DeepSeek | budget | $0.04 | $5.08 |
| Gemini 3.5 Flash-Lite | budget | $0.07 | $8.38 | |
| Gemini 3.8 Flash | mid-tier | $0.12 | $14.94 | |
| Grok 4.3 | xAI | mid-tier | $0.14 | $16.44 |
| GPT-5.4 mini | OpenAI | budget | $0.14 | $16.74 |
| DeepSeek V4 Pro | DeepSeek | mid-tier | $0.16 | $19.32 |
| GPT-6.1 Terra | OpenAI | mid-tier | $0.16 | $19.56 |
| Gemini 4 Hydrogen | mid-tier | $0.24 | $29.34 | |
| Grok 4.7 | xAI | flagship | $0.27 | $32.40 |
| GPT-6.2 Sol | OpenAI | mid-tier | $0.33 | $39.12 |
| Claude Sonnet 5.5 | Anthropic | mid-tier | $0.33 | $39.12 |
| Gemini 4 Neon | flagship | $0.49 | $58.68 | |
| Claude Opus 5.5 | Anthropic | flagship | $0.65 | $78.24 |
| Gemini 4 Carbon | flagship | $0.65 | $78.24 | |
| Gemini 4 Argon | flagship | $0.65 | $78.24 | |
| Claude Fable 5.2 | Anthropic | flagship | $1.29 | $155.04 |
| GPT-6.2 Astra | OpenAI | flagship | $1.30 | $156.48 |
The three picks
1. GPT-6 Luna (OpenAI, $0.02 per coding hour) — Cheapest GPT-6 family model; long context $0.20 / $0.75.
2. Claude Haiku 5.5 (Anthropic, $0.02 per coding hour) — Rate applies to prompts up to 100K tokens; above that $0.50 / $2.50.
3. GPT-5.4 nano (OpenAI, $0.04 per coding hour) — Previous-generation nano tier.
Every model above is linked to its own rate card. If a provider on this list is close enough in price that quality decides, the side-by-side comparisons put two models on one calculator, and the LLM API calculator takes your own counts.
What would change the answer
Three things move a task ranking: a long-context surcharge for prompts past each provider's threshold, a batch discount (usually 50%) for asynchronous jobs, and reasoning tokens billed as output on the newer models. None of them is in the figures above, so treat the ranking as the list-price answer and the calculator as the final one.
Questions
What is the cheapest model for coding agents?
GPT-6 Luna at $0.02 per coding hour, or $1.99 a month at 4 coding hours a day. Second and third are Claude Haiku 5.5 and GPT-5.4 nano. The ranking is cost only: quality, latency and rate limits are not in it.
Should I use the cheapest model even if quality matters?
At this task shape the cheapest three sit within $0.02 of each other per coding hour, so it is worth testing quality on the top two rather than defaulting. The gap to the most expensive model is 79 times.
What is the cheapest flagship model here?
Grok 4.7 at $0.27 per coding hour — 16.3 times the cheapest model, for a flagship tier.
Work out your own number
- Cheapest for chatbots — support and assistant traffic
- Cheapest for coding — the same method
- LLM API cost calculator — your own token counts against 20 models
- Subscription vs API break-even — when a $20 plan beats metered API calls
- AI subscription receipt — what a stack of consumer plans adds up to
- All 30 comparisons — two models side by side with a live calculator
Tools that keep the bill down
The rate table is half the answer. These two move the token count itself.
Make.com — run the flow without the cron script
Every retry is a second billed request. Make fires the flow on a schedule or webhook, retries inside the run and logs each one, so the monthly line stops being a guess.
Firecrawl — pages into clean markdown
Turn a web page into LLM-ready markdown so the tokens you pay for are the content, not the markup around it.
Affiliate disclosure: we may earn a commission if you subscribe through these links, at no extra cost to you. See the privacy and disclosure page.