Laalaa Docs

Usage & quota

Every key has a billable token quota. Inspect it via the usage endpoint or the Check key page.

GET /v1/usage

Returns quota and consumption for the authenticated key — no upstream round-trip.

bash
curl https://api.laalaa.me/v1/usage \  -H "Authorization: Bearer sk-xxxxxxxxxxxx"
200 OK
{
  "valid": true,
  "label": "My Key",
  "tokens_total": 10000000,
  "tokens_used": 1234567,
  "tokens_remaining": 8765433,
  "requests": 42,
  "created_at": "2026-09-01T08:00:00.000Z",
  "expires_at": "2026-09-10T08:00:00.000Z",
  "last_used_at": "2026-09-07T02:41:00.000Z",
  "status": "active"
}

Fields

FieldMeaning
validalways true on a 200 response
labelthe key's display name
tokens_totalgranted quota (billable tokens)
tokens_usedconsumed (billable tokens)
tokens_remainingtotal − used
requestsnumber of routed requests
created_at / expires_at / last_used_atISO timestamps; expires_at is null when the key never expires
status"active" on a 200 response

What “billable” means

Quota is deducted in billable tokens, which can differ from the actual tokens a provider reports because each Server Option can carry its own markup.

Billable = ceil(actual × markup) per category (input / output / cache), then summed.
  • 429 when the per-key request-rate guard trips (abuse protection).
  • 402 quota_exhausted when the quota runs out.
  • Friendly view: the Check key page
ទំព័រនេះមានប្រយោជន៍?