estimate_cost
Estimates Claude API cost for Haiku, Sonnet, Opus using token counts or raw text. Supports prompt-caching ratio and multiple calls.
Instructions
Estimate Claude API cost across Haiku/Sonnet/Opus for given token counts (or raw text). Optional prompt-caching ratio.
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 |
|---|---|---|---|
| input_text | No | Raw input text (used if input_tokens omitted) | |
| input_tokens | No | Input token count (overrides input_text) | |
| output_tokens | No | Expected output tokens (default 500) | |
| cache_ratio | No | Fraction of input served from cache, 0-1 (cached input is 10x cheaper) | |
| calls | No | Number of calls to project total cost for |