GetUsageStats
GET/v1/usage/stats
GetUsageStats returns an organization's usage over time, read from the usage rollups: totals, a time series, and groups by model, user, team, API key or usage mode.
Unlike the request-log reads above, this is gated on metrics_reader and usage.read, the same grant as the metrics API. It returns aggregates only, never a request body or a client address.
A request that names customer_id is authorized against that customer: an organization viewer of that customer, or a key of that customer, may call it. A request that names no customer reads every customer and needs a platform usage.read grant. A non-admin key is always confined to its own customer, and to its own project for a project-tier key.
Request
Responses
- 200
Success