Skip to content
LLMs

Cheapest LLMs for coding

Mistral: Mistral Nemo is the cheapest option at $0.019 per million input tokens. Coding workloads read a lot of context and call tools constantly, so tool support and a large context window matter as much as the headline price.

260 models qualify

Ranked by blended cost - input weighted 75%, output 25%.

Language models with price per million tokens and context window
#ModelBlended / 1MInput / 1MOutput / 1MContextCapabilities
1$-1000000.0000$-1000000.0000$-1000000.00002M
ReasoningToolsVision
2
OpenRouter logo
Auto Router

OpenRouter

$-1000000.0000$-1000000.0000$-1000000.00002M
ReasoningToolsVision
3FreeFreeFree262K
Free tierReasoningToolsVisionOpen weights
4FreeFreeFree262K
Free tierReasoningToolsVisionOpen weights
5FreeFreeFree262K
Free tierReasoningTools
6FreeFreeFree512K
Free tierReasoningToolsVision
7FreeFreeFree256K
Free tierReasoningToolsOpen weights
8FreeFreeFree256K
Free tierReasoningToolsVisionOpen weights
9FreeFreeFree200K
Free tierReasoningToolsVision
10
Mistral AI logo
Mistral Nemo

Mistral AI

$0.022$0.019$0.030131K
ToolsOpen weights
11
inclusionAI logo
Ling 3.0 Flash

inclusionAI

$0.032$0.021$0.063262K
ReasoningToolsOpen weights
12$0.055$0.030$0.1301M
ReasoningToolsVision
13$0.055$0.030$0.130131K
ReasoningToolsOpen weights
14$0.057$0.050$0.080131K
ToolsOpen weights
15$0.061$0.035$0.140128K
Tools
16
Inception logo
Mercury 2.5

Inception

$0.068$0.040$0.150260K
ReasoningTools
17$0.070$0.037$0.170131K
ReasoningToolsOpen weights
18$0.075$0.060$0.1201.3M
ReasoningToolsOpen weights
19$0.075$0.060$0.120262K
Free tierReasoningToolsOpen weights
20$0.075$0.050$0.150131K
ToolsVisionOpen weights
21$0.084$0.048$0.193262K
ToolsOpen weights
22$0.087$0.050$0.200262K
ReasoningToolsOpen weights
23$0.090$0.060$0.180131K
Free tierReasoningToolsVisionOpen weights
24$0.090$0.060$0.180262K
Free tierReasoningTools
25$0.100$0.100$0.100131K
ToolsVisionOpen weights

Frequently asked

What is the cheapest LLM for code generation and refactoring?

Mistral: Mistral Nemo at $0.019 per million input tokens and $0.030 per million output tokens, with a 131K token context window.

How many models qualify for code generation and refactoring?

260 of the 340 models tracked here meet the criteria for this list.

How much do prices vary within this category?

By roughly 3,100×, from Mistral Nemo at the bottom to GPT-5.4 Pro at the top.