Query the available account balance with an authorized model API token.
GET /api/usage/token/
Auth: {'type': 'bearer', 'prefix': 'sk-'}
Send Authorization: Bearer <MODEL_API_KEY> with no query parameters or request body. In Token Management, turn on Allow account balance queries. The permission is off by default. A token without this permission receives HTTP 403.
Authorization | string | required | Model API token in Bearer <MODEL_API_KEY> format. |
200 — 账号可用余额 / Available account balance400 — Bad Request401 — Unauthorized403 — Forbidden429 — Too Many Requests503 — Service Unavailablecurl --request GET "https://api.router.ai/api/usage/token/" \
--header "Authorization: Bearer ${MODEL_API_KEY}"Read data.user_quota.total_available. It is an integer and can be zero or negative. Divide by 500,000 to convert to USD. data.unlimited_quota is always true for compatibility with New API balance refresh. Tokens under one account share a rolling limit of 10 requests per 60 seconds. For HTTP 429, wait as directed by Retry-After.