calculate_estimate
Estimate token costs for any model by providing input and output token counts, with optional prompt caching discounts.
Instructions
Estimate the cost for a given number of input and output tokens on a specific model. Supports optional cached_tokens for prompt caching discounts.
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": {
"model_name": "<model_name>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "calculate_estimate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_name | Yes | Model name (fuzzy matched) | |
| input_tokens | Yes | Number of input tokens | |
| output_tokens | Yes | Number of output tokens | |
| cached_tokens | No | Number of input tokens served from cache (prompt caching). Must be <= input_tokens. These tokens are billed at the cached rate instead of the standard input rate. |