Estimate Token Cost
tokencost_estimate_costCalculate token usage costs for AI models by specifying model, input tokens, and output tokens to get a detailed cost breakdown in USD.
Instructions
Calculate the cost for a specific number of input and output tokens with a given model.
Args:
model (string): Model ID or name
input_tokens (number): Number of input tokens (0 to 100B)
output_tokens (number): Number of output tokens (0 to 100B)
Returns: Cost breakdown with input cost, output cost, and total cost in USD.
Examples:
model="gpt-5", input_tokens=1000, output_tokens=500 → Cost for a typical API call
model="claude-sonnet-4.6", input_tokens=100000, output_tokens=4000 → Cost for a long context call
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model ID or name | |
| input_tokens | Yes | Number of input tokens | |
| output_tokens | Yes | Number of output tokens |