Skip to main content
Docs
Usage

Usage

Retrieve current-period usage, token counts and credit balance for your organization.

Returns what your organization has spent this billing period, how many tokens that came to, and what credit remains. Use it to surface spend inside your own dashboard, or to alert before a balance runs dry.

Endpoint

GET https://api.elyxir.ai/api/v1/usage

Authentication

This is a Platform API endpoint — OAuth JWT plus organization header, not an elyxir_ key.

HeaderRequiredDescription
AuthorizationYesBearer <oauth-jwt>
X-Organization-IdYesYour organization UUID

Example

curl https://api.elyxir.ai/api/v1/usage \
  -H "Authorization: Bearer <oauth-jwt>" \
  -H "X-Organization-Id: 00000000-0000-0000-0000-000000000000"

Response

{
  "organization": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Acme Corp",
    "slug": "acme-corp",
    "plan": "standard"
  },
  "currentPeriod": {
    "start": "2026-08-01T00:00:00.000Z",
    "end": "2026-09-01T00:00:00.000Z"
  },
  "usage": {
    "totalCost": "12.45",
    "totalTokens": 2450000,
    "promptTokens": 1800000,
    "completionTokens": 650000
  },
  "limits": {
    "inferenceTokensLimit": 5000000
  },
  "credits": {
    "currentBalance": 37.55,
    "totalPurchased": 100.0,
    "totalSpent": 62.45
  }
}

Fields

FieldDescription
organization.planCurrent plan code
currentPeriodThe billing window these figures cover
usage.totalCostSpend this period, in USD, as a string
usage.totalTokensPrompt plus completion tokens
limitsCeilings that apply on this plan. Additional keys may appear here over time — read the ones you need rather than assuming the shape is fixed
credits.currentBalanceCredit-pack balance remaining

Errors

StatusMeaning
401Invalid or expired JWT
403Not a member of this organization

Notes

Figures cover the current billing period and reset when it rolls over. If you need a longer history, record snapshots yourself — or use the cost dashboard in Studio, which retains history and breaks spend down by model and project.

Usage | Alvin