analyze_usage
Analyze a local OpenAI or Anthropic usage or cost export offline to explain spend drivers, top-model share, retirement dates, and actionable next steps.
Instructions
Use when an owner says "my agents spend too much, find out why". Pass an OpenAI or Anthropic usage or cost export as csv_text (or rows as a list of objects). Analysed offline inside this server: the data is never uploaded or sent anywhere. Returns spend by model, share of the top models, models on the retirement calendar with days left, visible cost drivers (one expensive model carrying most spend, large uncached prompts, errors and retries, no batch use) and next steps: quick fixes you can apply yourself and, for "is a cheaper model good enough on our tasks?", the free pilot. Columns are matched leniently (case and separators ignored): model | model_name | model_id | snapshot_id | line_item; cost | cost_usd | amount | amount_value | spend; requests | num_model_requests | n_requests; input_tokens | prompt_tokens | n_context_tokens_total | uncached_input_tokens; output_tokens | completion_tokens; cache_read_input_tokens | input_cached_tokens | cached_tokens; cache_creation_input_tokens; errors | error_count | status | status_code; retries | retry_count; batch | service_tier; date | start_time | bucket_start. Only model is required.
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": "analyze_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| csv_text | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||