calculate_cost
Calculate the cost of an AI model inference given token usage
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>",
"provider_id": "<provider_id>",
"prompt_tokens": "<prompt_tokens>",
"completion_tokens": "<completion_tokens>"
},
"name": "calculate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes | Model ID, e.g. "gpt-4o" | |
| provider_id | Yes | Provider ID, e.g. "openai" | |
| prompt_tokens | Yes | ||
| reasoning_tokens | No | ||
| web_search_count | No | ||
| cache_read_tokens | No | ||
| completion_tokens | Yes | ||
| cache_write_tokens | No |