LLM API cost calculator
Enter your token counts and your provider's prices. The maths runs in your browser.
Result
Enter an input price and an output price to see the cost.
How the number is calculated
Providers bill input and output tokens separately, each at a price per million tokens. For one request:
cost = uncached_input / 1,000,000 × input_price
+ cached_input / 1,000,000 × cached_price
+ output / 1,000,000 × output_priceThe cached part is your input tokens multiplied by the cache share. The daily figure multiplies by requests per day, and the monthly figure assumes 30 days.
Getting the inputs right
- Use measured token counts. Every API response reports the input and output tokens it used. Average those over real requests rather than guessing from character counts.
- Input is the whole prompt. The system prompt, earlier turns, retrieved documents and tool definitions are all billed on every request, not just the latest user message.
- Agents multiply everything. One user task that takes ten tool calls is ten requests, each re-sending the growing conversation. Count requests per day accordingly.
- Prices change. This page stores no prices on purpose. Copy them from your provider's current pricing page.
What this does not cover
Cache-write surcharges, batch discounts, image or audio input, and per-request tool fees are not modelled. If you use them, treat the result as a baseline.