Get account member AI usage analytics

http
GET /account/users/{user_id}/analytics/ai-usage

Return one current member's AI credit usage across the authorized account's projects, from the project ledger. Requires account.billing.read.

Parameters

NameInRequiredDescription
user_idpathYesCurrent member in the authorized account. This reads the project ledger, not the member personal account or quota rollups. API keys and runtime service credentials are refused.
presetqueryWhole local days, defaulting to 30d. Explicit from/to bounds take precedence over preset, including SDK-supplied defaults.
fromqueryInclusive start. Supply both from and to; these bounds take precedence over preset.
toqueryExclusive end, no later than the end of today in timezone.
timezonequery
granularityqueryUTC hours, or local calendar days, Monday-based weeks and months.
group_byqueryGrouping dimensions supported by this operation. Repeat the parameter or use a comma-separated list.
comparequeryCompare preceding calendar months for whole-month custom ranges, local days for whole-day ranges and presets, or equal elapsed duration otherwise.

Responses

StatusDescription
200Recorded member AI usage billed to the authorized account, with bounded time controls and optional grouping/comparison.
400Bad request
401Unauthorized
403Forbidden
404Not found
500Server error