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.
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 |