Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
GET | /billing/tenants/:tenantId/credits | Get a tenant credit balance | [User+Key] tenants:read |
GET | /billing/tenants/:tenantId/usage/summary | Get tenant usage totals | [User+Key] tenants:read |
GET | /billing/tenants/:tenantId/usage/logs | List tenant usage records | [User+Key] tenants:read |
POST | /billing/organizations/:orgId/credits | Add credits to an organization | [User] admin |
POST | /billing/tenants/:tenantId/credits | Allocate organization credits to a tenant | [User] admin |
GET | /billing/organizations/:orgId | Get organization billing and tenant balances | [User] |
GET | /billing/organizations/:orgId/usage/summary | Get organization usage totals | [User] |
GET | /billing/organizations/:orgId/usage/logs | List organization usage records | [User] |
Tenant read endpoints accept either a user session or an API key with
tenants:read and access to the tenant. Organization billing endpoints require a user session; credit writes require owner or billing_admin.Tenant billing
Get a credit balance
GET /billing/tenants/:tenantId/credits
Returns credits_pool, credits_used, and credits_available, where available credits are the allocated pool minus usage.
Tenant ID.
Get a usage summary
GET /billing/tenants/:tenantId/usage/summary
Returns aggregate credits, tokens, input tokens, output tokens, and message count for the tenant.
Tenant ID.
List usage logs
GET /billing/tenants/:tenantId/usage/logs
Returns paginated request-level records with model, token counts, credits used, related chat, caller key, and timestamp information.
Tenant ID.
Start date in
YYYY-MM-DD format.End date in
YYYY-MM-DD format.Number of results to return, from 1 to 500. The default is 50.
Number of records to skip.
Return usage attributed to a specific API key.
Return only API-key-driven usage when
true.Allocate credits to a tenant
POST /billing/tenants/:tenantId/credits
Moves available organization credits into the tenant’s credit pool.
Tenant to fund.
Credits to allocate, greater than zero and no more than 1,000,000.
Organization billing
Add organization credits
POST /billing/organizations/:orgId/credits
Adds credits to the organization’s current billing pool.
Organization ID.
Credits to add, greater than zero and no more than 1,000,000.
Get organization billing
GET /billing/organizations/:orgId
Returns the current billing period, total allocated and used credits, available credits, status, and each tenant’s allocation and usage.
Organization ID.
Get organization usage summary
GET /billing/organizations/:orgId/usage/summary
Returns aggregate credit, token, and message totals across the organization’s tenants.
Organization ID.
List organization usage logs
GET /billing/organizations/:orgId/usage/logs
Accepts the same start_date, end_date, limit, offset, api_key_id, and is_api_key filters as tenant usage logs, then returns matching records across the organization.
Organization ID.
Next steps
Tenants
Configure tenant quotas and initial credit pools.
Rate limits
Understand request throttling separately from credits.
Organizations
Manage the top-level billing owner.