Learn to calculate by playing with AI token cost calculator
A short game to see where the result comes from. Pick a language and start; you can stop halfway and come back.
Loading the game…
← Back to AI token cost calculator
What you will practise
What each request to a language model costs and the monthly bill, with prompt caching, reasoning tokens and batch discounts.
How it works
Each kind of token is divided by a million and multiplied by its price: uncached input at the input price, input read from cache at its own price, and output and reasoning at the output price. They are added up and, if there is a discount, it is applied to the total. The result is then scaled by the number of requests and days.
The saving from caching is the difference between paying for that share of the input at the normal price or at the cache price.
Formula
Cost per request = [ input · (1 − c) · input price + input · c · cache price + (output + reasoning) · output price ] ÷ 1,000,000 · (1 − discount)
Monthly cost = cost per request × requests per day × days of use
Annual cost = monthly cost × 12
c = fraction of the input read from cache
Worked example
Example 1. A simple chatbot.
4,000 input tokens at 3 per million, 800 output at 15 per million and 500 requests a day: 0.024 per request, 12 a day, 360 a month and 4,320 a year. Half the cost is output, even though it is five times fewer tokens.
Example 2. With prompt caching.
An assistant with 20,000 tokens of context (instructions and documents) and 1,000 of output, 1,000 requests a day. If 80% of the context is read from cache at 0.30 per million: 954 a month instead of 2,250, saving 1,296 a month.
Example 3. A reasoning model.
2,000 input tokens, 500 visible output and 3,000 reasoning, 200 requests a day: 0.0585 per request and 351 a month. Reasoning is 77% of the cost and total output (visible plus reasoning), almost 90%.
Example 4. Batch processing.
5,000 input tokens and 1,500 output, 2,000 requests a day, with a 50% discount: 1,125 a month instead of 2,250.
How to play
First pick your language. Then work through the challenges one by one: each sets out a case with real numbers and, if you get stuck, you can ask for a hint. When you answer, you see whether you got it right and why. Progress is saved only in your browser, so you can stop halfway and carry on another day.