Estimate what a request costs
estimateThe cost of a request on every chat model (or the ids given), cheapest first, with the developer's list cost and the saving. Give input_tokens, or a prompt / messages to count from. With the caller's key, prices are the key's own (price locks included). Live from POST /v1/estimate.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| models | No | Model ids to price. Default: every chat model, cheapest first. | |
| prompt | No | Text to estimate the prompt tokens from, instead of input_tokens. | |
| messages | No | Chat messages to estimate from, instead of input_tokens. | |
| input_tokens | No | Prompt tokens. Give this or a prompt / messages to count from. | |
| output_tokens | No | Completion tokens. Default 1000. |