AI retry & cache cost calculator.
Estimate one AI workload using supplied token counts, retry assumptions and cached versus uncached input prices.
CALCULATED, NOT PREDICTED
Your result
Enable JavaScript to calculate your own inputs. The worked example below is available without JavaScript.
Sharing is optional. A copied scenario link contains these numbers; never share confidential assumptions.
The formula
Attempts = requests × (1 + average extra attempts). Per-attempt cost = ((input − cached) × input rate + cached × cached rate + output × output rate) / 1,000,000. Total = attempts × cost.
A worked example
Using Requests in the period = 10000; Average extra attempts per request = 0.1; Input tokens per attempt = 2000; Cached input tokens per attempt = 1000; Output tokens per attempt = 500; Uncached input USD per million tokens = 2; Cached input USD per million tokens = 0.5; Output USD per million tokens = 8:
- Expected attempts
- 11000.000000
- Estimated total (USD)
- 71.500000
- Increment from retries (USD)
- 6.500000
- Difference from using uncached input (USD)
- 16.500000
Exact rational arithmetic, rounded half up to six decimal places at display.
What this result does and does not establish
Each attempt is assumed to use the same tokens and cache hit amount. Partial failures, routing and varying context lengths are not modeled. Prices are supplied by you; fictional defaults are not current provider pricing.
Review the underlying recordsDownload example inputs and expected outputs · Embed this calculator