TokAPI Docs

Usage API

Check your remaining TokAPI budget as percentages with GET /v1/usage.

The Usage API reports how much of your budget you have consumed. It returns percentages only — never USD amounts or per-token cost.

Endpoint

GET https://api.tokapi.ai/v1/usage

Authenticate with the key whose usage you want to inspect:

Authorization: Bearer sk-lazytech-...

The usage returned is for the key used to authenticate the request.

Example

curl https://api.tokapi.ai/v1/usage \
  -H "Authorization: Bearer sk-lazytech-..."

Response shape

The object is api_key.usage. Budget consumption is reported under budget as percentages. Keys on a subscription tier also include a subscription block with rolling 5-hour and weekly windows (the block is omitted for keys that are not on a subscription tier):

{
  "object": "api_key.usage",
  "id": "key_abc",
  "name": "Main Key",
  "redacted_value": "sk-lazytech-...abcd",
  "created_at": 1711471533,
  "last_used_at": 1711555126,
  "foundation": "all",
  "budget": {
    "used_percent": 40,
    "remaining_percent": 60
  },
  "subscription": {
    "product_id": "prod_pro",
    "five_hour": { "window_seconds": 18000, "used_percent": 30, "remaining_percent": 70 },
    "weekly": { "window_seconds": 604800, "used_percent": 42, "remaining_percent": 58 }
  }
}

used_percent and remaining_percent are percentages of your allotted budget. TokAPI does not expose cost-per-token or USD spend through this endpoint.

On this page