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

All 20 models at 120,000 input / 20,000 output tokens per coding hour, 50% of the input cached, ranked by cost, checked December 1, 2026.
ModelProviderTierPer coding hourPer month
GPT-6 LunaOpenAIbudget$0.02$1.99
Claude Haiku 5.5Anthropicbudget$0.02$1.99
GPT-5.4 nanoOpenAIbudget$0.04$4.58
DeepSeek FlashDeepSeekbudget$0.04$5.08
Gemini 3.5 Flash-LiteGooglebudget$0.07$8.38
Gemini 3.8 FlashGooglemid-tier$0.12$14.94
Grok 4.3xAImid-tier$0.14$16.44
GPT-5.4 miniOpenAIbudget$0.14$16.74
DeepSeek V4 ProDeepSeekmid-tier$0.16$19.32
GPT-6.1 TerraOpenAImid-tier$0.16$19.56
Gemini 4 HydrogenGooglemid-tier$0.24$29.34
Grok 4.7xAIflagship$0.27$32.40
GPT-6.2 SolOpenAImid-tier$0.33$39.12
Claude Sonnet 5.5Anthropicmid-tier$0.33$39.12
Gemini 4 NeonGoogleflagship$0.49$58.68
Claude Opus 5.5Anthropicflagship$0.65$78.24
Gemini 4 CarbonGoogleflagship$0.65$78.24
Gemini 4 ArgonGoogleflagship$0.65$78.24
Claude Fable 5.2Anthropicflagship$1.29$155.04
GPT-6.2 AstraOpenAIflagship$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