LLMCost
Guides · Updated 2026-10-21

Cheapest LLMs for Coding & Agentic Work

Coding agents need tool/function calling — without it, no file edits or shell commands. Every model below supports tools, ranked cheapest first. For agentic workloads also check the context window: 128K+ is recommended.

💡 Current leader: OpenAI: gpt-oss-20b at $0.018 input / $0.090 output per 1M tokens.

Ranking (25 models)

#ModelInput /1MOutput /1MContext
1OpenAI: gpt-oss-20b
openai
$0.018$0.090131K
2inclusionAI: Ling 3.0 Flash
inclusionai
$0.021$0.063262K
3OpenAI: gpt-oss-20b (batch)
openai
$0.024$0.112131K
4OpenAI: GPT-5 Nano (batch)
openai
$0.025$0.200400K
5Mistral: Mistral Nemo
mistralai
$0.029$0.030131K
6OpenAI: gpt-oss-120b (batch)
openai
$0.030$0.136131K
7Qwen: Qwen3.7 Flash
qwen
$0.030$0.1301M
8Z.ai: GLM 5.2
z-ai
$0.034$7.001.0M
9Amazon: Nova Micro 1.0
amazon
$0.035$0.140128K
10Inception: Mercury 2.5
inception
$0.040$0.150260K
11Qwen: Qwen3.8 27B
qwen
$0.040$1.351M
12DeepSeek: DeepSeek V4 Flash Latest
~deepseek
$0.048$0.1571.0M
13DeepSeek: DeepSeek Flash Latest
~deepseek
$0.049$0.3751.0M
14DeepSeek: DeepSeek V4.1 Flash
deepseek
$0.049$0.3751.0M
15OpenAI: GPT-5 Nano
openai
$0.050$0.400400K
16LiquidAI: LFM2.5-24B-A2B
liquid
$0.050$0.700128K
17Anthropic: Claude Haiku 5.5 (batch)
anthropic
$0.050$0.2501M
18Upstage: Solar Mini 4
upstage
$0.050$0.200524K
19OpenAI: GPT-6 Luna Pro (batch)
openai
$0.050$0.2501.1M
20OpenAI: GPT-6 Luna (batch)
openai
$0.050$0.2501.1M
21DeepSeek: DeepSeek V4.1 Flash (batch)
deepseek
$0.050$0.1501.0M
22Z.ai: GLM 5.3 Flash (batch)
z-ai
$0.050$0.1801.0M
23Google: Gemini 2.5 Flash Lite (batch)
google
$0.050$0.2001.0M
24OpenAI: GPT-4.1 Nano (batch)
openai
$0.050$0.2001.0M
25Google: Gemma 3 12B
google
$0.050$0.150131K

Prices are list prices via OpenRouter, verified 2026-10-21. Provider first-party pricing may differ (volume discounts, batch tiers).

FAQ

What is the cheapest LLM API for coding?
The cheapest tool-calling models change as providers reprice — this page ranks them live. Budget open-weight models typically cost under $0.50 per 1M input tokens while still supporting function calling.
Do cheap models work with coding agents?
Yes, if they support tool calling. Quality varies: budget models handle file edits and simple refactors well, but complex multi-step planning still favors frontier models. A common pattern is routing planning to a frontier model and edits to a budget one.
How much does a coding agent cost per month?
A typical coding-agent workload (5,000 requests/month at ~8K input/2K output tokens) ranges from under $10/month on budget models to several hundred on frontier models. Use our calculator for your exact numbers.

Estimate your own bill with the cost calculator · Browse all 458 models · More buying guides