Get Workspace Usage
GET /workspaces/{workspace_id}/usageOne workspace’s usage.
The workspace is narrowed onto the scope, not filtered in a WHERE clause written
here: an organization principal asking about a workspace it does not own gets the empty
set from the same predicate that governs every other read (I-01), rather than from a
check this handler would have to remember to perform.
Parameters
Section titled “Parameters”| Name | In | Type | Notes | |
|---|---|---|---|---|
workspace_id | path | string (uuid) | required | — |
from | query | string (date-time) | null | optional | — |
to | query | string (date-time) | null | optional | — |
group_by | query | agent | model | provider | day | workspace | credential | trigger | persona | null | optional | — |
Responses
Section titled “Responses”| Status | Description | Body |
|---|---|---|
200 | Successful Response | UsageSummaryView |
422 | Validation Error | HTTPValidationError |
Example
Section titled “Example”curl -X GET https://your-deployment.example.com/workspaces/{workspace_id}/usage \ -H "Authorization: Bearer $COBRE_TOKEN"Response — UsageSummaryView
Section titled “Response — UsageSummaryView”| Field | Type | Notes | |
|---|---|---|---|
window_start | string (date-time) | required | — |
window_end | string (date-time) | required | — |
group_by | agent | model | provider | day | workspace | credential | trigger | persona | null | optional | — |
currency | string | optional | Default "USD". |
total | UsageBucket | required | — |
groups | UsageBucket[] | optional | — |
unpriced_calls | integer | optional | Default 0. |