Usage breakdown
spicrawl_usageBilling-grade usage for your org over a date window, from the daily rollup (usage_daily), grouped by day, project, engine, feature or key. group_by=key returns per API key (key_id, name, prefix, project_id) counters per metric per day, from usage_key_daily; keyless (dashboard) usage is not in it, and a project-scoped key sees only its own project's keys. Use it to answer 'how many requests/credits did I use, and where'. The window defaults to the last 30 days including today; to is EXCLUSIVE (a single day 2026-08-01 is from=2026-08-01, to=2026-08-02) and the window may not exceed 400 days. The response carries stale_seconds (age of the newest rollup row; null when the window is empty). Requires the key to have the read scope.
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": "spicrawl_usage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | EXCLUSIVE end date, YYYY-MM-DD (UTC). Default: tomorrow, so today is included. | |
| from | No | Inclusive start date, YYYY-MM-DD (UTC). Default: 29 days before today. | |
| metrics | No | Metrics to return. Omit for all of them. | |
| group_by | No | How to group the rows. Default 'day'. | |
| project_id | No | Restrict to one project id (must be a valid Spicrawl identifier). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | group_by=key only: one entry per API key, with its counters per UTC day. | |
| groups | No | The buckets, sorted by key. Empty (or missing for group_by=key) does not mean no usage: read totals. | |
| period | No | The window, as a half-open range of UTC days. | |
| totals | No | Billed quantities for the whole window. Authoritative; use these, not the sum of groups. | |
| group_by | No | The dimension used: day, project, engine, feature or key. | |
| warnings | No | Caveats the numbers would otherwise hide. | |
| usage_as_of | No | When the newest rollup row in the window was written; null when the window is empty. | |
| unattributed | No | The part of each total the groups do not explain. | |
| stale_seconds | No | Age of usage_as_of in seconds; null when the window is empty. A large value means the rollup is behind. |