Estimate the cost of one LLM request across models
estimate_costPrice one LLM request (input + expected output) on many models at once, cheapest first, with current list prices from each provider's own pricing page (source URL and check date included), prompt-cache and batch discounts, long-prompt surcharges and announced price changes. Also says whether the request fits each model's context window. Call this before an expensive request to pick a model or to stay inside a budget.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "estimate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Price on this day (YYYY-MM-DD), to see announced price changes. Default today. | |
| text | No | Prompt text. Counted with an estimator, never stored. | |
| batch | No | Price with the provider's batch API discount where one is listed. | |
| models | No | Model ids to compare, e.g. ["claude-sonnet-5-5", "gpt-6.2-sol", "gemini-3.8-flash"]. Omit to compare every listed model. list_models gives every id. | |
| system | No | System prompt text. | |
| messages | No | Chat messages [{role, content}]. Counted with an estimator, never stored. | |
| providers | No | Only these providers. | |
| input_tokens | No | Exact input token count, if you have it. Overrides text and gives an exact cost. | |
| output_tokens | No | Expected output tokens (or the max_tokens you will allow). | |
| cached_input_tokens | No | How many input tokens will be read from the prompt cache. |