latestOpenAPI 3.1.02026-08-223391355.6 KB

aa8d44585147

billing-usage

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.

get/v1/workspaces/{workspace_id}/billing/credit-usage

Path parameters

workspace_idstring required

Workspace ID

Workspace ID

Query parameters

group_by'member' | 'project'

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.

interval'day' | 'week' | 'month'

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.

start_datestring date required

Required inclusive start (UTC day).

Required inclusive start (UTC day).

end_datestring date

Inclusive end (UTC day). Defaults to today (UTC).

Inclusive end (UTC day). Defaults to today (UTC).

category'all' | 'build' | 'run'

Filter credits to All, Build, or Run.

Filter credits to All, Build, or Run.

project_idstring

Optional: restrict to a single project's usage.

Optional: restrict to a single project's usage.

user_idstring

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.

limitinteger

Maximum number of items to return

Maximum number of items to return

cursorstring

Opaque pagination cursor returned by the previous page

Opaque pagination cursor returned by the previous page

Response

OK

entity_countinteger

Number of grouped entities across all pages; group_by queries only.

workspace_totalnumber double required

Total matching credits across the whole window — same on every page, not just this page's rows.