Usage API
Read usage and remaining budget for a OneKeyLLM key.
GET /v1/usage returns the budget for the sk-lazytech-* key used to
authenticate the request.
curl https://api.tokapi.ai/v1/usage \
-H "Authorization: Bearer $ONEKEYLLM_API_KEY"Response
{
"object": "api_key.usage",
"id": "key_abc",
"name": "Claude Prod",
"redacted_value": "sk-lazytech-...abcd",
"created_at": 1711471533,
"last_used_at": 1711555126,
"budget": {
"limit_usd": "50200.000000000",
"used_usd": "751.154232800",
"remaining_usd": "49448.845767200"
}
}limit_usd, used_usd, and remaining_usd are decimal strings to avoid
precision issues. Convert them to numbers only for display.
Interactive page
The public /en/usage page calls this endpoint from the browser.
It does not store the key and does not pass through a Next.js backend route.
Budget schema
| Field | Type | Description |
|---|---|---|
limit_usd | string | Total budget configured on the key. |
used_usd | string | Amount already consumed. |
remaining_usd | string | Remaining budget. |