Estimate cost
estimate_costCalculate the cost of an LLM workload for a chosen model from official API prices, accounting for input, output, cached tokens, tiers, and long-context pricing.
Instructions
Cost of a workload on one model from official prices. input_tokens is the whole prompt per request; cached_input_tokens and cache_write_tokens are the parts of it read from / written to the prompt cache. The long-context band is chosen from the per-request token counts. Use tier for batch/flex/priority prices. When a model has several prices for the same request (thinking vs non-thinking, peak vs off-peak) every variant is returned with a range unless mode/time pins one down.
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": "<model>",
"input_tokens": "<input_tokens>",
"output_tokens": "<output_tokens>"
},
"name": "estimate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "thinking" or "non-thinking", for models priced by mode. | |
| tier | No | standard (default), batch, flex, priority or fast. | |
| time | No | For models with time-of-day prices. | |
| model | Yes | Model id, alias, display name or "provider/id". | |
| region | No | Price region when the provider lists several, e.g. "intl". Default: the main region. | |
| currency | No | Also give the total converted to this currency (≈). | |
| provider | No | ||
| requests | No | Number of identical requests. Default 1. | |
| input_tokens | Yes | Prompt tokens per request, cached part included. | |
| output_tokens | Yes | Output tokens per request (reasoning tokens included). | |
| cache_write_ttl | No | Which cache-write price to use: short (default, e.g. 5 min) or long (e.g. 1 h). | |
| cache_write_tokens | No | Prompt tokens per request written to the cache. | |
| cached_input_tokens | No | Prompt tokens per request read from the cache (cache hits). |