How Does LLM API Pricing Work?
How input/output token pricing works and what actually drives your bill.
Most LLM providers price API usage per million tokens, and almost always split the rate into two numbers: an input (prompt) price and an output (completion) price. Output tokens are typically priced higher than input tokens because generating text is more computationally expensive than reading it.
The basic formula
input cost = (input tokens / 1,000,000) × input price per million
output cost = (output tokens / 1,000,000) × output price per million
total cost = input cost + output costMultiply by the number of requests you expect, and the cost scales linearly — which is exactly what our LLM Cost Calculator does for a single request, and what the AI Project Cost Calculator does for a whole application.
What actually drives your bill
- Prompt length — system prompts, few-shot examples, and conversation history all count as input tokens on every request.
- Retrieved context — in RAG systems, retrieved chunks are added to the input on every query.
- Output length — verbose responses cost more than concise ones, often at a higher per-token rate than input.
- Request volume — cost is linear in requests, so small per-request savings compound quickly at scale.
A note on accuracy
Provider pricing changes over time and varies by region, tier, and model version. Any pricing shown in a calculator on this site is clearly marked as example/demo data — always confirm current rates on the provider's official pricing page before making a purchasing decision.