Skip to main content
Billing balance, costs, items, events, and rates (feature-gated: enable_billing_endpoints)

Endpoints


Get credit balances

GET /api/v1/billing/balance Returns credit balances for the platform. All billing endpoints require M2M (service account) credentials.

Parameters

Responses

200 - Credit balances
400 - Invalid request (e.g., expired or malformed cursor) 401 - Unauthorized 403 - Forbidden 502 - Billing service unavailable

Query daily costs

GET /api/v1/billing/costs Returns daily cost breakdown with date range and workspace filtering. Date ranges cannot exceed 366 days.

Parameters

Responses

200 - Daily costs
400 - Invalid request (date range too wide, inverted, or malformed cursor) 401 - Unauthorized 403 - Forbidden

Get cost summary

GET /api/v1/billing/costs/summary Returns aggregated cost summary by currency for a date range. Date ranges cannot exceed 366 days.

Parameters

Responses

200 - Cost summary
400 - Invalid request (date range too wide or inverted) 401 - Unauthorized 403 - Forbidden

List billing items

GET /api/v1/billing/items Returns billing line items (active/closed) for the platform.

Parameters

Responses

200 - Billing items
400 - Invalid request (e.g., malformed cursor) 401 - Unauthorized 403 - Forbidden

Get billing item

GET /api/v1/billing/items/{id} Returns a single billing item by ID. Returns 404 when the item does not belong to the caller’s platform/account scope to avoid leaking cross-tenant existence.

Parameters

Responses

200 - Billing item
401 - Unauthorized 403 - Forbidden 404 - Item not found

List billing events

GET /api/v1/billing/events Returns billing event history for the platform. Date ranges cannot exceed 366 days.

Parameters

Responses

200 - Billing events
400 - Invalid request (date range too wide, inverted, or malformed cursor) 401 - Unauthorized 403 - Forbidden

List rates

GET /api/v1/billing/rates Returns the rate schedule (price list) for the platform. Paginated per API-0012; consumers must iterate until pagination.hasMore is false.

Parameters

Responses

200 - Rate schedule
400 - Invalid request (e.g., malformed cursor) 401 - Unauthorized 403 - Forbidden