Cheapest AI to write a SQL query (Oct 2026)
The cheapest model overall is Summarize at <0.01¢ per task. If you want a top-quartile model, the cheapest is DeepSeek V4.1 Flash at 0.03¢.
10 cheapest models
Any model with a price, including small and older ones.
| # | Model | Cost per task | WebDev score | Tokens in / out | Basis | |
|---|---|---|---|---|---|---|
| 1 | S SummarizeScaledown | <0.01¢$0.0071 / 1,000 | - | 177 / 2,630 | estimated | |
| 2 | S ExtractScaledown | <0.01¢$0.0071 / 1,000 | - | 177 / 2,630 | estimated | |
| 3 | gpt-oss-20bOpenAI | <0.01¢$0.04 / 1,000 | 1317 | 126 / 459 | estimated best value | |
| 4 | Mistral NemoMistral | <0.01¢$0.10 / 1,000 | - | 121 / 3,158 | estimated | |
| 5 | S Llama 3 8B LunarisSao10K | 0.01¢$0.14 / 1,000 | - | 177 / 2,630 | estimated | |
| 6 | gpt-oss-safeguard-20bOpenAI | 0.01¢$0.15 / 1,000 | - | 126 / 459 | estimated | |
| 7 | Gemma 3 4BGoogle | 0.02¢$0.17 / 1,000 | 1303 | 135 / 1,589 | estimated | |
| 8 | I Ling 3.0 FlashInclusionai | 0.02¢$0.17 / 1,000 | - | 176 / 2,629 | estimated | |
| 9 | GPT-5 NanoOpenAI | 0.02¢$0.19 / 1,000 | 1338 | 126 / 459 | estimated best value | |
| 10 | N Nex-N2.5-MiniNex Agi | 0.02¢$0.22 / 1,000 | - | 145 / 2,129 | estimated |
Cheapest high-quality models
Only models in the top 25% of LMArena WebDev scores (≥ 1513).
| # | Model | Cost per task | WebDev score | Tokens in / out | Basis | |
|---|---|---|---|---|---|---|
| 1 | DeepSeek V4.1 FlashDeepSeek | 0.03¢$0.32 / 1,000 | 1618 | 145 / 2,129 | measured best value | |
| 2 | GLM 5.3 FlashZ.ai | 0.03¢$0.33 / 1,000 | 1606 | 128 / 1,596 | measured | |
| 3 | DeepSeek V4 Flash 0423DeepSeek | 0.04¢$0.40 / 1,000 | 1581 | 145 / 2,129 | estimated | |
| 4 | GPT-6 LunaOpenAI | 0.04¢$0.40 / 1,000 | 1578 | 126 / 782 | measured | |
| 5 | MiMo-V2.6-ProXiaomi | 0.07¢$0.74 / 1,000 | 1625 | 274 / 708 | estimated best value | |
| 6 | MiMo-V2.6-FlashXiaomi | 0.08¢$0.76 / 1,000 | 1634 | 175 / 2,626 | estimated best value | |
| 7 | Claude Haiku 5.5Anthropic | 0.08¢$0.84 / 1,000 | 1585 | 182 / 1,650 | measured | |
| 8 | DeepSeek V4 Pro 0423DeepSeek | 0.09¢$0.92 / 1,000 | 1582 | 145 / 2,129 | estimated | |
| 9 | GPT-5.6 LunaOpenAI | 0.10¢$0.96 / 1,000 | 1519 | 126 / 782 | estimated | |
| 10 | GLM 5.2Z.ai | 0.39¢$3.94 / 1,000 | 1605 | 128 / 1,596 | estimated |
Cheapest model of each lab
| Model | Cost per task | Score |
|---|---|---|
gpt-oss-20bOpenAI | <0.01¢$0.04 / 1,000 | 1317 |
Mistral NemoMistral | <0.01¢$0.10 / 1,000 | - |
Gemma 3 4BGoogle | 0.02¢$0.17 / 1,000 | 1303 |
Llama 3.1 8B InstructMeta | 0.02¢$0.22 / 1,000 | 1211 |
DeepSeek V4.1 FlashDeepSeek | 0.03¢$0.32 / 1,000 | 1618 |
GLM 5.3 FlashZ.ai | 0.03¢$0.33 / 1,000 | 1606 |
Qwen3.7 FlashAlibaba Qwen | 0.03¢$0.35 / 1,000 | - |
MiMo-V2.6-ProXiaomi | 0.07¢$0.74 / 1,000 | 1625 |
MiniMax M2.5MiniMax | 0.07¢$0.74 / 1,000 | 1386 |
Claude Haiku 5.5Anthropic | 0.08¢$0.84 / 1,000 | 1585 |
Kimi K2 0711Moonshot AI | 0.18¢$1.80 / 1,000 | 1418 |
Grok Build 0.1xAI | 0.44¢$4.42 / 1,000 | - |
FAQ
What is the cheapest AI to write a SQL query?
The cheapest model overall is Summarize at <0.01¢ per task. If you want a top-quartile model, the cheapest is DeepSeek V4.1 Flash at 0.03¢.
Is the cheapest model good enough?
Often not for hard tasks. That is why this page also lists the cheapest models in the top quarter of LMArena scores and the cheapest model of every major lab.