get_ai_cost
Calculate the cost of AI model usage from input and output tokens or units, including batch discounts and currency conversion, to estimate API expenses.
Instructions
Alias for calculate_ai_cost: calculate the cost of an AI model usage based on tokens or units.
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_id": "<model_id>"
},
"name": "get_ai_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| batch | No | Apply Batch API discount if supported (default: false) | |
| units | No | Number of units for non-text models (images, seconds, minutes, songs, clips, 1M chars, or months) | |
| currency | No | Target currency code (default: 'USD') | |
| model_id | Yes | Model ID or alias (e.g., 'gpt-6.2-astra', 'claude-opus-5.5', 'gemini-4-carbon', 'grok-4.7', 'deepseek-v4.1-flash', 'veo-3.1') | |
| input_tokens | No | Uncached input tokens (for text models) | |
| output_tokens | No | Output completion tokens (for text models) | |
| cached_input_tokens | No | Cached input tokens billed at cache-read rate |