Home › Blog › LLM API Cost Calculator
LLM API Cost Calculator
Enter your traffic, your average token counts and your model's prices. The calculator shows what each request costs and what your monthly bill will be.
Example prices. Replace them with your model's current rates from your provider's pricing page. A month is 30 days.
Cost per request = (uncached input tokens × input price + cached input tokens × cached price + output tokens × output price) ÷ 1,000,000. Multiply by requests per day for your daily spend.
The formula
Prices are quoted per million tokens, which is why the total is divided by 1,000,000.
Where to find your numbers
- Token counts: every API response includes a usage object with input, output and cached token counts. Average them from your logs instead of guessing. No logs yet? Paste a typical prompt into the token counter.
- Requests per day: your provider's usage dashboard, or your own request logs.
- Prices: your provider's pricing page for the exact model you call. Output is usually priced several times higher than input.
How to bring the number down
Raise the cached share by keeping the start of your prompts identical, move background work to batch APIs, and send simple routes to smaller models. The guides for OpenAI and Anthropic walk through each step.
Want us to find your 20%?
Book a free 15-minute API cost teardown. Bring last month's provider usage and we'll show you your biggest waste and the first fix we'd ship.
Get My Free 15-Minute API Cost TeardownFrequently asked questions
How accurate is this calculator?
As accurate as the numbers you enter. Use average token counts from your own logs and the current prices for your model.
How do I include batch discounts?
The batch APIs at OpenAI and Anthropic charge half the standard rate, so halve both prices for routes that run in batch.
Why does output cost more than input?
Providers price output tokens higher than input tokens, often several times higher, so long replies and reasoning add up fast.