Get User Daily Activity
[BETA] This is a beta endpoint. It will change.
Meant to optimize querying spend data for analytics for a user.
Reads daily spend records that only ever accumulate and are never affected by budget resets. Their total can legitimately exceed the spend field returned by /v2/user/info, which is a running budget counter that every budget reset sets back to zero (or to the overage above max_budget when budget_rollover is enabled).
Returns: (by date)
- spend
- prompt_tokens
- completion_tokens
- cache_read_input_tokens
- cache_creation_input_tokens
- total_tokens
- api_requests
- breakdown by model, api_key, provider
Query parameters
Start date in YYYY-MM-DD format
Start date in YYYY-MM-DD format
End date in YYYY-MM-DD format
End date in YYYY-MM-DD format
Filter by specific model
Filter by specific model
Filter by specific API key
Filter by specific API key
Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id.
Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id.
Page number for pagination
Page number for pagination
Items per page
Items per page
Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention.
Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention.
When the range ends on the caller's current local day, extend it to today's UTC bucket so spend written after the caller's local midnight (in UTC terms) is included. Requires the timezone parameter. Historical ranges are never extended.
When the range ends on the caller's current local day, extend it to today's UTC bucket so spend written after the caller's local midnight (in UTC terms) is included. Requires the timezone parameter. Historical ranges are never extended.
Response
Successful Response