calculate_estimate
Estimate the cost for a given number of input and output tokens on a specific model. Useful for budgeting API calls or comparing the cost of different approaches.
| Parameter | Type | Required | Description |
|---|---|---|---|
model_name | string | Yes | Model name (fuzzy matched) |
input_tokens | number | Yes | Number of input tokens |
output_tokens | number | Yes | Number of output tokens |
Example
Section titled “Example”Request:
{ "model_name": "claude-sonnet-4-5", "input_tokens": 1000, "output_tokens": 500}Response:
Cost Estimate for claude-sonnet-4-5
Input: 1K tokens × $3.00/1M = $0.003000 Output: 500 tokens × $15.00/1M = $0.007500 ───────────────────────────── Total: $0.0105- Token counts must be non-negative integers
- The model name is fuzzy matched, same as
get_model_details - Pricing is based on the per-token rates from the LiteLLM registry