ReferenceUsage

Get LLM token usage

Token and cost accounting for every LLM call attributable to your tenant.

Always scoped to your own tenant — the tenant is derived server-side, so there is no parameter that could read another tenant's usage.

Usage billed to your own provider key (bring-your-own-key) is reported for visibility but never charged: those rows always show credits_charged: 0.

GET
/api/v1/usage/llm

Authorization

ApiKeyAuth
x-api-key<token>

A platform key (ck_live_…). Mint one in the console under Settings → API Keys.

In: header

Query Parameters

dimension?string

What to group the totals by.

Default"tenant"

Value in

  • "tenant"
  • "workspace"
  • "memory"
  • "space"
  • "conversation"
  • "user"
  • "api_key"
  • "model"
id?string

The id of the dimension being queried.

from?string
Formatdate
to?string
Formatdate
group_by?string

Value in

  • "day"
  • "model"

Response Body

application/json

curl -X GET "https://example.com/api/v1/usage/llm"
{  "totals": {    "input_tokens": 0,    "output_tokens": 0,    "calls": 0,    "cost_usd": 0.1,    "credits_charged": 0,    "byok_tokens": 0  },  "series": [    {      "key": "string",      "input_tokens": 0,      "output_tokens": 0,      "calls": 0,      "cost_usd": 0.1,      "credits_charged": 0,      "byok_tokens": 0    }  ]}
Was this page helpful?
Report an issue