Documentation

GET /v1/usage

Every request your key makes is logged — this endpoint reads that same log back to you. Totals, per-endpoint split, error buckets, latency percentiles and coverage breakdown are computed live from RequestLog and match a direct SQL count exactly. Three windows (24h / 7d / 30d), your key only — never another key, never another tenant.

GET /v1/usage api-key #

Read your own usage meter — the key sees only its own RequestLog rows. Returns quota state plus three windows (24h/7d/30d) of totals, per-endpoint counts, disjoint error buckets, latency percentiles and coverage tallies. No dashboard needed: the numbers are the API.

Example

curl -X GET https://agw.orcanox.xyz/v1/usage \
  -H "Authorization: Bearer agw_…"

Response

json
{
  "key": {
    "name": "default",
    "scopes": [
      "read",
      "search"
    ],
    "createdAt": "2026-10-01T09: 00: 00.000Z"
  },
  "quota": {
    "limit": 10000,
    "used": 1234,
    "remaining": 8766,
    "resetsAt": "2026-11-01T00: 00: 00.000Z"
  },
  "windows": [
    {
      "range": "24h",
      "total": 40,
      "byEndpoint": {
        "search": 20,
        "read": 12,
        "research": 8
      },
      "errors": {
        "402": 0,
        "429": 1,
        "4xx": 2,
        "5xx": 0
      },
      "latencyMs": {
        "avg": 340,
        "p50": 210,
        "p95": 980,
        "max": 1500
      },
      "coverage": {
        "official": 15,
        "bestEffort": 5
      }
    }
  ],
  "generatedAt": "2026-10-05T12: 00: 00.000Z"
}