costs
Get total OpenAI spend, daily breakdowns, and month-end forecasts for any date range. Group data by project or line item and identify anomalies.
Instructions
Query OpenAI dollar-amount spend data.
USE THIS TOOL FOR:
Total spend over a date range (summary mode, default)
Daily cost breakdown by line item or project
Month-to-date spend with projected month-end forecast
Identifying cost anomalies (spike days highlighted in summary)
DO NOT USE THIS TOOL FOR:
Token or request counts (use 'usage' tool instead)
Comparing two different months side by side (use 'cost-comparison' tool)
DETAIL LEVELS:
summary (default): Compact total + top-N breakdown table (~20 lines). Includes projected month-end spend and anomaly detection when applicable.
daily: Per-day breakdown with per-item amounts.
raw: Full unprocessed data, every line item every day.
DEFAULTS: detail_level='summary', group_by='line_item', top_n=10, end_time=today
EXAMPLES:
This month's spend: start_time="2026-03-01"
Last 7 days by project: start_time="2026-03-23", group_by="project_id"
Daily breakdown for February: start_time="2026-02-01", end_time="2026-03-01", detail_level="daily"
Dates in YYYY-MM-DD format.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| end_time | No | ||
| group_by | No | ||
| start_time | Yes | ||
| detail_level | No | summary |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |