AI retry & cache cost
calculate_retry_cache_costEstimate one AI workload using supplied token counts, retry assumptions and cached versus uncached input prices. Numeric scenarios only. 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"requests": "<requests>",
"retries": "<retries>",
"input": "<input>",
"cached": "<cached>",
"output": "<output>",
"input_rate": "<input_rate>",
"cached_rate": "<cached_rate>",
"output_rate": "<output_rate>"
},
"name": "calculate_retry_cache_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Input tokens per attempt | |
| cached | Yes | Cached input tokens per attempt | |
| output | Yes | Output tokens per attempt | |
| retries | Yes | Average extra attempts per request | |
| requests | Yes | Requests in the period | |
| input_rate | Yes | Uncached input USD per million tokens | |
| cached_rate | Yes | Cached input USD per million tokens | |
| output_rate | Yes | Output USD per million tokens |