Authorization: Bearer <key> header. Keys are org-scoped — the key implicitly identifies which org the request belongs to.
Obtaining a key
Keys are generated in the OpenQuota admin UI (Settings → API Keys). Only admins can create or revoke keys. On creation you pick:- Name — a human-readable label for this key’s purpose.
- Scopes — the minimum set of scopes this key needs. See below.
- Rate limit — requests per minute. Defaults to 1000.
oqp_ followed by 64 hex characters of entropy. The server stores only a SHA-256 hash — we literally cannot tell you what the plaintext was if you lose it. Revoke and rotate.
Scopes
| Scope | Grants |
|---|---|
deals:read | GET /v1/deals |
deals:write | POST /v1/deals/events |
earnings:read | GET /v1/earnings, GET /v1/earnings/:id |
plans:read | GET /v1/plans, GET /v1/plans/:id |
{"error":"forbidden","reason":"missing scope: <scope>"}. Grant the minimum set.
The request header
Rotation
Rotate regularly. Workflow:- Create a new key with the same scopes.
- Deploy the new key to your callers.
- Verify traffic is flowing via the new key (its
last_used_atupdates on every successful call). - Revoke the old key in the admin UI.
Observability
Every authenticated request:- Updates
last_used_aton the key (fire-and-forget, so it doesn’t block the response). - Emits an audit entry visible in the OpenQuota admin’s audit log.
- Returns
X-RateLimit-*response headers (see Rate limits).