Usage

Last updated:

On this page

Every usage endpoint requires your API key and returns only your own account's data. Use them for dashboards, budget alerts, or to let an agent watch its own consumption.

Fastest path: the whole picture in one call

GET /v1/usage/summary bundles the current window, the daily series, the per-model breakdown and rate-limit events into a single response. Handy for tools that would otherwise poll several endpoints.

bash
curl "https://api.staik.se/v1/usage/summary?days=30" \
  -H "Authorization: Bearer sk-st-your-key"
json
{
  "current": {
    "tokens_used": 1200,
    "tokens_limit": 250000,
    "tokens_used_today": 1200,
    "daily_limit": 250000,
    "tokens_used_hour": 0,
    "hourly_limit": null,
    "requests_today": 8,
    "plan_name": "Hobby",
    "purchased_tokens_remaining": 0
  },
  "days": 30,
  "daily": [{ "day": "2026-09-09", "tokens": 1200, "requests": 8 }],
  "by_model": [{ "model": "qwen3.6:35b-a3b", "tokens": 1200, "requests": 8 }],
  "rate_limits": { "total": 0, "breakdown": {} }
}

days controls the window for daily, by_model and rate_limits (default 30, clamped to 1–90). current always reflects the current window.

Canonical endpoints

EndpointReturns
GET /v1/usageCurrent window for the dashboard: consumption, limits, requests today, recent calls, queue position (prioritized plans)
GET /v1/usage/summary?days=NEverything below in one call (see above)
GET /v1/usage/history?days=NDaily series { day, tokens, requests }, zero-padded per day
GET /v1/usage/models?days=NPer-model breakdown { model, tokens, requests }
GET /v1/usage/rate-limits?days=NHow often you hit a limit, total + by reason

N is clamped to 1–90 days (default 30).

Aliases

So you don't have to guess, three aliases return an identical response to their canonical counterpart: GET /v1/usage/daily (= history), GET /v1/usage/by-model (= models) and GET /v1/usage/limits (= rate-limits).

Example: daily series

bash
curl "https://api.staik.se/v1/usage/history?days=7" \
  -H "Authorization: Bearer sk-st-your-key"
json
{
  "days": 7,
  "series": [
    { "day": "2026-09-03", "tokens": 0, "requests": 0 },
    { "day": "2026-09-09", "tokens": 1200, "requests": 8 }
  ]
}

Rate limits and your remaining quota are also returned as response headers (X-RateLimit-Remaining-Tokens and friends) on every /v1/chat/completions call — see Errors & limits.