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)
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