How do you calculate LLM cost?
LLM cost is input tokens times the input price, plus output tokens times the output price. Prices are quoted per million tokens, so divide by one million.
Here's a real sum using list prices checked on 24 November 2026. The prompt has 2,000 input tokens and the reply has 500.
| Model | Input price | Output price | One request | 100,000 requests |
|---|---|---|---|---|
| Claude Sonnet 5.5 | $2 | $10 | $0.009 | $900 |
| GPT-6.2 Sol | $2 | $10 | $0.009 | $900 |
| GPT-6.1 Terra | $1 | $5 | $0.0045 | $450 |
| GPT-6 Luna | $0.10 | $0.50 | $0.00045 | $45 |
Notice that 500 output tokens cost more than 2,000 input tokens in every row. Short answers save money.
Which LLM API is cheapest?
The cheapest price per token isn't always the cheapest job. If a small model fails one time in five and you retry on a bigger one, your real cost goes up. Test quality on twenty real prompts, then compare prices among the models that passed.
What pushes an API bill up?
- Long system prompts sent with every request
- Chat history that grows with each turn
- Large JSON payloads, which the JSON token counter can break down
- Prompts that cross a model's long context threshold and move to a higher rate
- Verbose replies with no length limit
Measure a typical prompt with the AI token counter before you enter it here.
How can you lower LLM costs?
Trim the system prompt, cap the output length and send simple tasks to a smaller model. Batch processing and prompt caching can reduce bills further. The calculator uses standard list prices, so real costs with those discounts should come in lower.