Spend breakdown
get_spendAI API spend in US dollars at list prices, split into input, cache reads, cache writes and output, grouped by day, team, provider, model, API key or tier, with optional filters.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_spend"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day, YYYY-MM-DD. Defaults to the latest day. | |
| key | No | API key name, as listed by list_api_keys. | |
| from | No | First day, YYYY-MM-DD. Defaults to the start of the data. | |
| team | No | Team name, as listed by get_spend_summary. | |
| model | No | Model name, for example Sonnet 5.5. | |
| group_by | No | How to group the totals. Default day. | |
| provider | No | claude (Anthropic) or openai. | |
| last_days | No | Only the most recent N days. Overrides from/to. |