Cheapest AI to write a SQL query (Nov 2026)
The cheapest model overall is Summarize at <0.01¢ per task. If you want a top-quartile model, the cheapest is GLM 5.3 Flash at 0.01¢.
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 | Gemma 3 4BGoogle | <0.01¢$0.08 / 1,000 | 1303 | 135 / 1,589 | estimated | |
| 5 | Mistral NemoMistral | <0.01¢$0.10 / 1,000 | - | 121 / 3,158 | estimated | |
| 6 | Llama 3.1 8B InstructMeta | 0.01¢$0.11 / 1,000 | 1211 | 175 / 2,626 | estimated | |
| 7 | I Ling 3.0 TinyInclusionai | 0.01¢$0.12 / 1,000 | - | 176 / 2,629 | estimated | |
| 8 | GLM 5.3 FlashZ.ai | 0.01¢$0.13 / 1,000 | 1607 | 128 / 1,596 | measured best value | |
| 9 | S Llama 3 8B LunarisSao10K | 0.01¢$0.14 / 1,000 | - | 177 / 2,630 | estimated | |
| 10 | gpt-oss-safeguard-20bOpenAI | 0.01¢$0.15 / 1,000 | - | 126 / 459 | estimated |
Cheapest high-quality models
Only models in the top 25% of LMArena WebDev scores (≥ 1540).
| # | Model | Cost per task | WebDev score | Tokens in / out | Basis | |
|---|---|---|---|---|---|---|
| 1 | GLM 5.3 FlashZ.ai | 0.01¢$0.13 / 1,000 | 1607 | 128 / 1,596 | measured best value | |
| 2 | DeepSeek V4 Flash 0423DeepSeek | 0.04¢$0.40 / 1,000 | 1582 | 145 / 2,129 | estimated | |
| 3 | GPT-6 LunaOpenAI | 0.04¢$0.40 / 1,000 | 1579 | 126 / 782 | measured | |
| 4 | DeepSeek V4.1 FlashDeepSeek | 0.04¢$0.43 / 1,000 | 1619 | 145 / 2,129 | measured best value | |
| 5 | MiniMax M3.1 FlashMiniMax | 0.05¢$0.46 / 1,000 | 1582 | 272 / 702 | estimated | |
| 6 | MiMo-V2.6-ProXiaomi | 0.07¢$0.74 / 1,000 | 1625 | 274 / 708 | estimated best value | |
| 7 | MiMo-V2.6-FlashXiaomi | 0.08¢$0.76 / 1,000 | 1637 | 175 / 2,626 | estimated best value | |
| 8 | Claude Haiku 5.5Anthropic | 0.08¢$0.84 / 1,000 | 1589 | 182 / 1,650 | measured | |
| 9 | DeepSeek V4.1 Flash 1017DeepSeek | 0.13¢$1.30 / 1,000 | 1665 | 145 / 2,129 | estimated best value | |
| 10 | GLM 5.3Z.ai | 0.22¢$2.24 / 1,000 | 1623 | 128 / 1,596 | estimated |
Cheapest model of each lab
| Model | Cost per task | Score |
|---|---|---|
gpt-oss-20bOpenAI | <0.01¢$0.04 / 1,000 | 1317 |
Gemma 3 4BGoogle | <0.01¢$0.08 / 1,000 | 1303 |
Mistral NemoMistral | <0.01¢$0.10 / 1,000 | - |
Llama 3.1 8B InstructMeta | 0.01¢$0.11 / 1,000 | 1211 |
GLM 5.3 FlashZ.ai | 0.01¢$0.13 / 1,000 | 1607 |
Qwen3.7 FlashAlibaba Qwen | 0.03¢$0.35 / 1,000 | - |
DeepSeek V4 Flash 0423DeepSeek | 0.04¢$0.40 / 1,000 | 1582 |
MiniMax M3.1 FlashMiniMax | 0.05¢$0.46 / 1,000 | 1582 |
MiMo-V2.6-ProXiaomi | 0.07¢$0.74 / 1,000 | 1625 |
Claude Haiku 5.5Anthropic | 0.08¢$0.84 / 1,000 | 1589 |
Kimi K2 0711Moonshot AI | 0.18¢$1.80 / 1,000 | 1418 |
Grok 4.3xAI | 0.55¢$5.52 / 1,000 | 1358 |
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 GLM 5.3 Flash at 0.01¢.
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.