Usage
GET /api/orgs/{org_id}/usage/cost
Section titled “GET /api/orgs/{org_id}/usage/cost”Get Usage Cost
COGS breakdown — byo provider spend vs platform cost. Admin/owner only
(dollar figures are org-sensitive). Checked against the path org, not a header,
so it can’t be bypassed with a mismatched X-Org-Id.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes | |
| window | query | string | no | Window: 24h, 7d, 30d (default 30d) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CostBreakdownResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/usage/series
Section titled “GET /api/orgs/{org_id}/usage/series”Get Usage Series
Time series for one metric, oldest→newest. 400 on an unknown/derived metric
(e.g. storage_bytes — use its component metrics) or bad granularity.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| granularity | query | string | no | One of (‘day’, ‘month’) |
| metric | query | string | yes | Rollup metric value (see the metric catalog) |
| org_id | path | string (uuid) | yes | |
| window | query | string | no | Window: 24h, 7d, 30d (default 30d) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | UsageSeriesResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/usage/summary
Section titled “GET /api/orgs/{org_id}/usage/summary”Get Usage Summary
Current usage for an org: counters summed over the window, gauges at their
latest reading (window-independent), derived storage_bytes, and cost totals.
Empty while metering is dark — no rollups yet means zeroed maps.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes | |
| window | query | string | no | Counter/cost window: 24h, 7d, 30d (default 30d) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | UsageSummaryResponse |
| 422 | Validation Error | HTTPValidationError |