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

MethodPathDescriptionAuth
GET/billing/tenants/:tenantId/creditsGet a tenant credit balance[User+Key] tenants:read
GET/billing/tenants/:tenantId/usage/summaryGet tenant usage totals[User+Key] tenants:read
GET/billing/tenants/:tenantId/usage/logsList tenant usage records[User+Key] tenants:read
POST/billing/organizations/:orgId/creditsAdd credits to an organization[User] admin
POST/billing/tenants/:tenantId/creditsAllocate organization credits to a tenant[User] admin
GET/billing/organizations/:orgIdGet organization billing and tenant balances[User]
GET/billing/organizations/:orgId/usage/summaryGet organization usage totals[User]
GET/billing/organizations/:orgId/usage/logsList 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.
tenantId
string
required
Tenant ID.
curl "https://api.autosage.ai/api/v1/billing/tenants/TENANT_ID/credits" \
  -H "Authorization: Bearer $AUTOSAGE_KEY"
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.
tenantId
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.
tenantId
string
required
Tenant ID.
start_date
string
Start date in YYYY-MM-DD format.
end_date
string
End date in YYYY-MM-DD format.
limit
number
Number of results to return, from 1 to 500. The default is 50.
offset
number
Number of records to skip.
api_key_id
string
Return usage attributed to a specific API key.
is_api_key
boolean
Return only API-key-driven usage when true.
curl "https://api.autosage.ai/api/v1/billing/tenants/TENANT_ID/usage/logs?start_date=2026-07-01&limit=50" \
  -H "Authorization: Bearer $AUTOSAGE_KEY"

Allocate credits to a tenant

POST /billing/tenants/:tenantId/credits Moves available organization credits into the tenant’s credit pool.
tenantId
string
required
Tenant to fund.
amount
number
required
Credits to allocate, greater than zero and no more than 1,000,000.
curl -X POST "https://api.autosage.ai/api/v1/billing/tenants/TENANT_ID/credits" \
  -H "Cookie: YOUR_SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 100 }'

Organization billing

Add organization credits

POST /billing/organizations/:orgId/credits Adds credits to the organization’s current billing pool.
orgId
string
required
Organization ID.
amount
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.
orgId
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.
orgId
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.
orgId
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.