Query balance

Get the real-time total Credits balance for the account that owns the API key. Queries are free and do not count toward model usage quotas.

GET/v1/billing/balance

Authentication

Use Authorization: Bearer <API_KEY>. The request has no body or account ID. The gateway identifies the account from the API key.

Management features are off by default for all API keys. The account Owner can turn on Enable management features under Access control when creating a key, or turn it on or off in the details of a key they created. Members of team and enterprise accounts cannot query the shared balance. Keys created by Members cannot query it even if they can call models. Keep authorized keys secret: anyone holding one can query the balance within the key’s access restrictions.

Request example

curl https://api.lyrouter.com/v1/billing/balance \
  -H "Authorization: Bearer $LYROUTER_API_KEY"

Response

{"balance_credit_micros":"12345678"}

balance_credit_micros is a signed integer encoded as a string. One Credit equals 1,000,000 micro-credits, so the example represents 12.345678 Credits. The endpoint also returns 200 for a zero or negative balance.

Status Meaning
401 API key is missing or invalid
402 The subscription has expired
403 The key lacks balance access, or an access restriction such as an IP allowlist applies
429 The balance query rate limit was exceeded
503 The live balance is unavailable or has not yet been initialized