query_usage
Query time-bucketed usage telemetry this account's own backend has pushed or synced in (e.g. API request counts, tokens processed) — the raw data unit-economics metrics divide cost by (see list_unit_metrics/query_unit_costs), inspected directly rather than through a pre-defined ratio. quantity is a raw count with no currency — never treat it as money. Optionally broken down by external_customer_id when the pushed rows carry one. Mirrors GET /api/usage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | ISO-8601 end of the date range (exclusive) | |
| group_by | No | Time bucket size (default: day). "hour" is only supported for ranges of 7 days or less. | |
| start_date | No | ISO-8601 start of the date range (inclusive) | |
| breakdown_by | No | "external_customer_id", or "dimension:<key>" to group by a key of the pushed dimensions map (e.g. "dimension:feature"; list the keys with list_usage_dimensions dimension "dimension_key"). Rows keep the external_customer_id field name; at most 50 values are returned, the rest folded into "Other". | |
| filter_metric | No | Restrict to these metric names | |
| exclude_metric | No | Leave out these metric names | |
| filter_category | No | Restrict to usage from sources in these categories (see query_costs for the list; customer-defined push sources count as "custom") | |
| exclude_category | No | Leave out usage from sources in these categories | |
| filter_source_id | No | Restrict to usage pushed/synced under these usage-source ids | |
| exclude_source_id | No | Leave out usage under these usage-source ids | |
| filter_external_customer_id | No | ||
| exclude_external_customer_id | No | Leave out these customers |