Cheapest models for coding
Ranked by input $/Mtoken, then output. Strong code generation and agent coding loops.
- 1GLM 5.2 (free)
Z Ai · 256,000 context
Input
$0/M
Output
$0/M
- 2MiniMax M3 (free)
Minimax · 1,048,576 context
Input
$0/M
Output
$0/M
- 3DeepSeek V4 Flash 0731
DeepSeek · 1,310,720 context
Input
$0.065/M
Output
$0.180/M
- 4Mistral Small 3.2 24B
Mistral · 131,072 context
Input
$0.075/M
Output
$0.200/M
- 5GLM 5.3 Flash (batch)
Z Ai · 1,048,576 context
Input
$0.075/M
Output
$0.250/M
- 6GLM 5.3 Flash
Z Ai · 1,310,720 context
Input
$0.075/M
Output
$0.250/M
- 7Llama 4 Scout
Meta · 1,310,720 context
Input
$0.100/M
Output
$0.300/M
- 8GPT-5.6 Luna (batch)
OpenAI · 1,050,000 context
Input
$0.100/M
Output
$0.600/M
- 9GPT-5.4 Nano (batch)
OpenAI · 400,000 context
Input
$0.100/M
Output
$0.625/M
- 10DeepSeek V4 Flash 0731 (batch)
DeepSeek · 1,048,576 context
Input
$0.110/M
Output
$0.330/M
- 11MiMo-V2.5
Xiaomi · 1,050,000 context
Input
$0.140/M
Output
$0.280/M
- 12GPT-4o-mini
OpenAI · 128,000 context
Input
$0.150/M
Output
$0.600/M
- 13Hy3 preview
Tencent · 262,144 context
Input
$0.180/M
Output
$0.600/M
- 14Llama 4 Maverick
Meta · 1,048,576 context
Input
$0.200/M
Output
$0.696/M
- 15GPT-5.6 Luna
OpenAI · 1,050,000 context
Input
$0.200/M
Output
$1.20/M
- 16GPT-5.4 Nano
OpenAI · 400,000 context
Input
$0.200/M
Output
$1.25/M
- 17Nex-N2-Pro
Nex Agi · 262,144 context
Input
$0.250/M
Output
$1.00/M
- 18DeepSeek V3.2
DeepSeek · 163,840 context
Input
$0.269/M
Output
$0.400/M
- 19GLM 5.2
Z Ai · 1,048,576 context
Input
$0.280/M
Output
$0.880/M
- 20Qwen3 Coder 480B A35B
Qwen · 262,144 context
Input
$0.300/M
Output
$1.00/M
- 21KAT-Coder-Pro V2
Kwaipilot · 262,144 context
Input
$0.300/M
Output
$1.20/M
- 22MiniMax M3
Minimax · 1,048,576 context
Input
$0.300/M
Output
$1.20/M
- 23MiniMax M3 (batch)
Minimax · 524,288 context
Input
$0.300/M
Output
$1.20/M
- 24DeepSeek V3
DeepSeek · 163,840 context
Input
$0.320/M
Output
$0.890/M
- 25Qwen3.7 Plus
Qwen · 1,000,000 context
Input
$0.320/M
Output
$1.28/M
- 26Gemini 3.8 Flash (batch)
Google · 1,048,576 context
Input
$0.375/M
Output
$1.88/M
- 27Gemini 3.7 Flash (batch)
Google · 1,048,576 context
Input
$0.375/M
Output
$1.88/M
- 28Gemini 3.6 Flash (batch)
Google · 1,048,576 context
Input
$0.375/M
Output
$1.88/M
- 29GPT-5.4 Mini (batch)
OpenAI · 400,000 context
Input
$0.375/M
Output
$2.25/M
- 30Qwen3.8 27B
Qwen · 1,000,000 context
Input
$0.420/M
Output
$3.00/M
- 31MiMo-V2.5-Pro
Xiaomi · 1,050,000 context
Input
$0.435/M
Output
$0.870/M
- 32DeepSeek V4 Pro 0813
DeepSeek · 1,048,576 context
Input
$0.579/M
Output
$1.74/M
- 33DeepSeek V4 Pro 0813 (batch)
DeepSeek · 1,048,576 context
Input
$0.660/M
Output
$1.98/M
- 34GLM 5.2 (batch)
Z Ai · 1,048,576 context
Input
$0.700/M
Output
$2.20/M
- 35GLM 5.3 (batch)
Z Ai · 1,048,576 context
Input
$0.700/M
Output
$2.20/M
- 36R1
DeepSeek · 64,000 context
Input
$0.700/M
Output
$2.50/M
- 37Kimi K2.7 Code
Moonshotai · 262,144 context
Input
$0.710/M
Output
$3.50/M
- 38Gemini 3.8 Flash
Google · 1,048,576 context
Input
$0.750/M
Output
$3.75/M
- 39Gemini 3.7 Flash
Google · 1,048,576 context
Input
$0.750/M
Output
$3.75/M
- 40Gemini 3.6 Flash
Google · 1,048,576 context
Input
$0.750/M
Output
$3.75/M