LLM API cost calculator
Work out what a prompt and answer cost per request, per month and per year from the prices you enter.
A clear answer. Here’s how.
Cost per request = (fresh input tokens × input price + cached tokens × cached price + output tokens × output price) ÷ 1,000,000, reduced by any discount. Fresh input is the input tokens minus the cached ones. Monthly cost multiplies by requests per day and days per month, and the yearly figure is twelve months. Prices are entered by you because providers change them often and Toolmoz keeps no price list; use the same currency for everything. Taxes, minimum charges, cache-write fees and rate-limit tiers are not modelled.
How this is checked
3 reference checks passed These 3 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Input tokens per request 2000Of those, tokens read from a cache 1500Output tokens per request 500Input price per million tokens 3Cached input price per million tokens 0.3Output price per million tokens 15Discount on the whole bill (%) 0Requests per day 1000Days per month 30
- Expected, and what Toolmoz gave
- Cost per request expected 0.00945, Toolmoz 0.00945Cost per month expected 283.5, Toolmoz 283.5Cost per year (12 months) expected 3402, Toolmoz 3402Input cost per request (fresh tokens) expected 0.0015, Toolmoz 0.0015Cached input cost per request expected 0.00045, Toolmoz 0.00045Output cost per request expected 0.0075, Toolmoz 0.0075
- Where the expected answer comes from
- 500 × 3 ÷ 1e6 = 0.0015, 1500 × 0.3 ÷ 1e6 = 0.00045, 500 × 15 ÷ 1e6 = 0.0075, total 0.00945; × 1000 × 30 = 283.50 a month (hand calculation)
- Allowed difference
- ±1e-9
Case 2
- Inputs
- Input tokens per request 1000000Of those, tokens read from a cache 0Output tokens per request 1000000Input price per million tokens 2Cached input price per million tokens 0Output price per million tokens 8Discount on the whole bill (%) 50Requests per day 1Days per month 1
- Expected, and what Toolmoz gave
- Cost per request expected 5, Toolmoz 5Share of the cost that is output expected 80, Toolmoz 80
- Where the expected answer comes from
- One million tokens each way: (2 + 8) × 50% = 5, and the output is 8 of the 10 before the discount, 80%
- Allowed difference
- ±1e-9
Case 3
- Inputs
- Input tokens per request 100Of those, tokens read from a cache 0Output tokens per request 0Input price per million tokens 10Cached input price per million tokens 1Output price per million tokens 30Discount on the whole bill (%) 0Requests per day 10Days per month 2
- Expected, and what Toolmoz gave
- Cost per request expected 0.001, Toolmoz 0.001Cost per month expected 0.02, Toolmoz 0.02Tokens per month (input and output) expected 2000, Toolmoz 2000
- Where the expected answer comes from
- 100 × 10 ÷ 1e6 = 0.001 per request, × 10 × 2 = 0.02 and 100 × 20 = 2,000 tokens (hand calculation)
- Allowed difference
- ±1e-12
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Input tokens per request
- 2000
- Of those, tokens read from a cache
- 1500
- Output tokens per request
- 500
- Input price per million tokens
- 3
- Cached input price per million tokens
- 0.3
- Output price per million tokens
- 15
- Discount on the whole bill (%)
- 0
- Requests per day
- 1000
- Days per month
- 30
Example result
- Cost per request
- 0.00945
- Cost per 1,000 requests
- 9.45
- Cost per month
- 283.5
- Cost per year (12 months)
- 3,402
- Input cost per request (fresh tokens)
- 0.0015
- Cached input cost per request
- 0.00045
- Output cost per request
- 0.0075
- Share of the cost that is output
- 79.4%
- Tokens per month (input and output)
- 75,000,000
Cost = tokens ÷ 1,000,000 × the price per million tokens, for fresh input, cached input and output, then multiplied by requests. Enter the prices from your provider’s current pricing page: this tool keeps no price list because they change often, and the figures use the same currency as your prices. Cached tokens are part of the input and are billed at the cached price. The discount applies to the whole bill (for example a batch discount). Taxes, minimum charges and cache-write fees are not included.