Estimate the cost of one request
estimate_costCost of one request from the recorded prices and the channel's billing rules (long-context thresholds, time-of-day prices, thinking-token billing), each rule with its source excerpt. Where the sources leave a question open the answer is a range with the reason, never a guess; a price that is not recorded is unknown. List prices as published by each channel at observed_at, USD per 1M tokens unless stated; China-site price lists are in CNY, listed separately and never converted. Standard (on-demand) plan unless service_plan says otherwise. The channel's own page is authoritative. Aggregator prices are the marketplace's own and never the reference. A missing price is unknown, not free. Not purchasing advice.
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 |
|---|---|---|---|
| at | No | Request time, ISO 8601, for channels that price by time of day | |
| model | Yes | Model id such as openai/gpt-6.1-sol, or an alias the channels use (gpt-6.1-sol, claude-opus-5-5). Case-insensitive. | |
| channel | No | Channel id; default is the official channel | |
| input_tokens | Yes | Uncached input tokens | |
| service_plan | No | Default STANDARD | |
| output_tokens | Yes | Visible output tokens, without thinking tokens | |
| reasoning_tokens | No | Thinking / reasoning tokens, counted separately from output_tokens | |
| cache_write_tokens | No | Tokens written to a cache | |
| cached_input_tokens | No | Tokens read from a cache |