qlk_live_…) has a scope:
| Scope | Can call | Notes |
|---|---|---|
standard | /v1/messages, /v1/chat/completions, /v1/audio/*, /v1/images/*, /v1/embeddings, /v1/videos, native passthrough URLs | What you give to end-users. |
admin (master) | Everything standard can, plus /v1/keys/* and /v1/usage | Server-side only. Don’t ship to clients. |
Why two scopes
If a user’s key gets stolen, the worst they can do is burn through that user’s spending cap. They can’t mint more keys, see other users’ usage, or revoke anything. Master keys, by contrast, can mint unlimited keys and read all usage. Treat them like a root password — store in a secret manager, never log, never expose to client-side code.Minting a key
scope defaults to "standard". Pass "admin" only when you genuinely
need another master key (most apps need exactly one).
Storing the secret
The full secret (qlk_live_<64 hex chars>) is returned once on
creation. We store only its SHA-256 hash, indexed for fast lookup.
When you store it on your end, treat it like a password:
- Encrypt at rest if your DB allows
- Don’t log it in cleartext
- Don’t put it in URL query strings
Revoking
GET /v1/usage), but they can never be re-enabled.
Mint a new one if the user comes back.
Listing
prefix (safe to
display in dashboards), scope, max_spend_usd, created_at,
last_used_at, revoked.