ScalixScalix Docs

Metering API

Usage metering and billing

REST API endpoints for Metering. 5 operations.

Get usage summary

plaintext
GET /api/v1/usage

Returns the caller's aggregate usage summary.

Auth: Bearer API key

Responses

StatusDescription
200Usage summary
401Missing or invalid API key
500Internal error

operationId: getUsageSummary

List per-key usage for the org

plaintext
GET /v1/usage/keys

Returns each of the organization's API keys with its request count for the current billing month. Requires the metering:read scope.

Auth: Bearer API key

Responses

StatusDescription
200Per-API-key request counts for the current month
401Missing or invalid API key
403Token lacks the metering:read scope
500Internal error

operationId: getKeysUsage

Get usage for one API key

plaintext
GET /v1/usage/keys/{key_id}

Returns the request count for a single API key this billing month. Requires the metering:read scope; the key must belong to the caller's org.

Auth: Bearer API key

Parameters

NameInTypeRequiredDescription
key_idpathstringYesAPI key id (UUID)

Responses

StatusDescription
200Usage detail for one API key this month
401Missing or invalid API key
403Token lacks the metering:read scope
404Key not found in this organization
500Internal error
501Billing not configured

operationId: getKeyUsage

Get the caller's budget

plaintext
GET /v1/user/budget

Returns current usage (AI tokens, storage, compute hours), the plan's allowances, and the remaining headroom for each.

Auth: Bearer API key

Responses

StatusDescription
200Usage, plan limits, and remaining allowance
401Missing or invalid credentials
500Database error

operationId: getUserBudget

Get the caller's usage stats

plaintext
GET /v1/user/stats

Returns a per-service usage breakdown (AI, storage, compute, bandwidth, functions) for the current month.

Auth: Bearer API key

Responses

StatusDescription
200Per-service usage for the current month
401Missing or invalid credentials
500Database error

operationId: getUserStats