Skip to main content
AutoSage meters model usage in credits. Tenant endpoints expose the balance and request-level usage; organization endpoints aggregate and allocate credits across tenants.

Endpoints

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.
string
required
Tenant ID.
When a tenant has insufficient credits, new chat or agent work can be rejected and scheduled runs are recorded as failed for insufficient credits. Allocate more credits before retrying.

Get a usage summary

GET /billing/tenants/:tenantId/usage/summary Returns aggregate credits, tokens, input tokens, output tokens, and message count for the tenant.
string
required
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.
string
required
Tenant ID.
string
Start date in YYYY-MM-DD format.
string
End date in YYYY-MM-DD format.
number
Number of results to return, from 1 to 500. The default is 50.
number
Number of records to skip.
string
Return usage attributed to a specific API key.
boolean
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.
string
required
Tenant to fund.
number
required
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.
string
required
Organization ID.
number
required
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.
string
required
Organization ID.

Get organization usage summary

GET /billing/organizations/:orgId/usage/summary Returns aggregate credit, token, and message totals across the organization’s tenants.
string
required
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.
string
required
Organization ID.
Use tenant logs for customer-level cost attribution and organization logs for finance reporting. The rate limits page covers throughput controls, which are separate from credit balance.

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.