aa8d44585147
Get workspace credit usage
Plan: Enterprise
Returns credit usage for a time window: one aggregate row by default, per-member or per-project rows with group_by, or time-bucketed rows with interval. Member-attributed rows (group_by=member, or a query filtered to one user_id) also carry the member's display_name and workspace email; project rows carry the project ID only (join the projects endpoint for the name). Grouped rows cover only entities with usage in the window (zero-usage members are omitted), and usage not attributed to a member or project counts toward workspace_total but appears in no row. Queries not restricted to the calling user (user_id=me) require workspace admin permission.
Path parameters
Workspace ID
Workspace ID
Query parameters
Group rows by member or project across the window. Omit for one workspace-wide aggregate row. Cannot be combined with interval.
Group rows by member or project across the window. Omit for one workspace-wide aggregate row. Cannot be combined with interval.
Bucket rows by time. Coarser intervals allow a longer window (~400 days at day, ~3 years at week, ~10 years at month). Cannot be combined with group_by.
Bucket rows by time. Coarser intervals allow a longer window (~400 days at day, ~3 years at week, ~10 years at month). Cannot be combined with group_by.
Required inclusive start (UTC day).
Required inclusive start (UTC day).
Inclusive end (UTC day). Defaults to today (UTC).
Inclusive end (UTC day). Defaults to today (UTC).
Filter credits to All, Build, or Run.
Filter credits to All, Build, or Run.
Optional: restrict to a single project's usage.
Optional: restrict to a single project's usage.
Optional: restrict to a single member's usage. Pass 'me' for the calling user; queries not restricted to the caller require workspace admin permission.
Optional: restrict to a single member's usage. Pass 'me' for the calling user; queries not restricted to the caller require workspace admin permission.
Maximum number of items to return
Maximum number of items to return
Opaque pagination cursor returned by the previous page
Opaque pagination cursor returned by the previous page
Response
OK