# What a SQL generation costs per month (December 2026)

Canonical: https://llmcostbot.com/en/workloads/sql-generation
Verified: 2026-12-02
License: CC BY 4.0 with attribution to LLMCostBot

## Answer

At 100,000 queries per month with 8,000 input and 4,000 output tokens per call, a SQL generation costs $58.52 per month on GLM 5.3 Flash with a 70% cache hit rate, at list prices verified 2026-12-02. This is an estimate, not a quote; assumptions and a ±30% range are below.

## Assumptions

- Volume: 100,000 queries per month
- Input tokens per call: 8,000
- Output tokens per call: 4,000
- Cache hit rate: 70%
- Retry rate: 1%
- Constraints: no context floor

These are example assumptions, not measured traffic. Costs are estimates, not quotes.

## Monthly cost by model

| Model | Meets constraints | Monthly | Without cache | Input / 1M | Output / 1M |
| --- | --- | ---: | ---: | ---: | ---: |
| GLM 5.3 Flash | Yes | $58.52 | $61.69 | $0.0356 | $0.0815 |
| Llama 4 Scout | Yes | $202.00 | $202.00 | $0.1 | $0.3 |
| Claude Haiku 5.5 | Yes | $231.90 | $282.80 | $0.1 | $0.5 |
| Qwen3.8 Flash | Yes | $235.29 | $311.08 | $0.15 | $0.47 |
| DeepSeek V4.1 Flash | Yes | $251.61 | $270.28 | $0.051 | $0.567 |
| Llama 4 Maverick | Yes | $584.99 | $686.80 | $0.35 | $1 |
| MiniMax M3 | Yes | $591.46 | $727.20 | $0.3 | $1.2 |
| GLM 5.3 | Yes | $621.51 | $622.08 | $0.0699 | $1.4 |
| Command A+ | Yes | $763.56 | $848.40 | $0.3 | $1.5 |
| Qwen3.8 27B | Yes | $839.75 | $840.32 | $0.06 | $1.96 |
| Devstral 2 2512 | Yes | $927.58 | $1,131 | $0.4 | $2 |
| DeepSeek V4 Pro 0423 | Yes | $936.41 | $1,296 | $0.8349 | $1.54 |

## Sensitivity

| Scenario | Monthly | Change |
| --- | ---: | ---: |
| Calls −30% (Volume falls to 70% of the assumption) | $40.97 | −$17.56 |
| Calls +30% (Volume rises to 130% of the assumption) | $76.08 | +$17.56 |
| No cache (Cache hit rate 0%) | $61.69 | +$3.17 |
| Cache 50% (Half of input tokens hit the cached price) | $59.43 | +$0.905 |
| Cache 80% (Most input tokens hit the cached price) | $58.07 | −$0.4525 |
| No retries (Retry rate 0%) | $57.94 | −$0.5794 |
| Retries 5% (Retry rate 5%) | $60.84 | +$2.32 |

## What is not included

Batch discounts, negotiated rates, credits, taxes, answer quality, latency, throughput, rate limits, region and retention are not included.
