Get usage summary
const url = 'https://example.com/v1/usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/usage \ --header 'Authorization: Bearer <token>'Return aggregated usage for the calling org over a time range.
Pass either period=current_month (or previous_month) for convenience, or an explicit period_start / period_end pair. The two modes are mutually exclusive.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Responses
Section titled “ Responses ”Successful Response
Aggregated usage; returned by GET /v1/usage.
object
Total billable seconds across all sessions in the window.
billable_seconds per quality tier. Forward-compatible breakdown — additional by_* slices may appear over time.
object
Exclusive end of the aggregated window. Matches the period_end query argument.
Inclusive start of the aggregated window. Matches the period_start query argument.
Number of sessions that contributed usage in the window.
Example
{ "billable_seconds": 14280, "by_quality": { "pro": 2280, "standard": 12000 }, "period_end": "2026-05-25T19:00:00Z", "period_start": "2026-05-01T00:00:00Z", "sessions": 42}Invalid period / range.
Wire format for every non-2xx public API response.
object
Concrete error returned inside ApiErrorEnvelope.error.
object
Stable machine-readable subcode (lower_snake_case). SDKs should switch on this, not message.
Human-readable summary. Not stable; do not parse.
Echo of the X-Request-Id response header for support.
Top-level error categories. Maps roughly to HTTP status.
code (a free-form lower_snake_case string on ApiError) is the
machine-readable subcode SDKs should switch on; type is the broad
category.
Example
{ "error": { "code": "transport.unsupported", "message": "transport.type=pipecat is reserved and not yet available", "param": "transport.type", "request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR", "type": "invalid_request" }}Missing or invalid API key.
Wire format for every non-2xx public API response.
object
Concrete error returned inside ApiErrorEnvelope.error.
object
Stable machine-readable subcode (lower_snake_case). SDKs should switch on this, not message.
Human-readable summary. Not stable; do not parse.
Echo of the X-Request-Id response header for support.
Top-level error categories. Maps roughly to HTTP status.
code (a free-form lower_snake_case string on ApiError) is the
machine-readable subcode SDKs should switch on; type is the broad
category.
Example
{ "error": { "code": "transport.unsupported", "message": "transport.type=pipecat is reserved and not yet available", "param": "transport.type", "request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR", "type": "invalid_request" }}Request body or parameters failed validation.
Wire format for every non-2xx public API response.
object
Concrete error returned inside ApiErrorEnvelope.error.
object
Stable machine-readable subcode (lower_snake_case). SDKs should switch on this, not message.
Human-readable summary. Not stable; do not parse.
Echo of the X-Request-Id response header for support.
Top-level error categories. Maps roughly to HTTP status.
code (a free-form lower_snake_case string on ApiError) is the
machine-readable subcode SDKs should switch on; type is the broad
category.
Example
{ "error": { "code": "transport.unsupported", "message": "transport.type=pipecat is reserved and not yet available", "param": "transport.type", "request_id": "req_01HXY5K8E7QYG3X8Z6N9R7S0VR", "type": "invalid_request" }}