Get aggregated usage analytics for the authenticated user with breakdowns by date, model, and API key. This endpoint provides summary views of your API usage, ideal for dashboards and usage monitoring. Data is cached for 10 minutes.
YYYY-MM-DD format. Both are required if either is provided.YYYY-MM-DD formatBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Lookback period for usage data. Format: number followed by "d" (e.g., "7d", "30d"). Maximum: 90d
^[1-9]\d*d$"7d"
Start date for filtering records (YYYY-MM-DD). If provided, endDate is also required.
^\d{4}-\d{2}-\d{2}$"2024-01-01T00:00:00.000Z"
End date for filtering records (YYYY-MM-DD). If provided, startDate is also required.
^\d{4}-\d{2}-\d{2}$"2024-01-31T00:00:00.000Z"
Successful response with aggregated usage analytics
Aggregated usage analytics response with breakdowns by date, model, and API key
The lookback period used for the query. Either "Nd" format or "startDate:endDate" format.
"7d"
Daily usage totals for the requested period
Usage breakdown by model, sorted by total spend (highest first)
Daily chart data for top 8 models. Each entry has "date" (timestamp) plus model names as keys.
Names of the top 8 models by usage (for chart legends)
Usage breakdown by API key, sorted by total spend (highest first)
Daily chart data for top 8 API keys. Each entry has "date" (timestamp) plus key descriptions as keys.
Descriptions of the top 8 API keys by usage (for chart legends)