Authentication
Every request to the nokai.studio API (except liveness probes) requires an API key in the Authorization header.
The header
Authorization: Bearer zpk_live_abcdefghijklmnopqrstuvwxyz0123456789ABCD
Keys always start with zpk_. Do not put the key in a URL query string -- it will appear in server logs, Referer headers, and CI screenshots.
Key format
zpk_live_<32-char-random-suffix>
- The prefix
zpk_live_is a hint for tooling; the API does not gate features on it. - The suffix is 32 random URL-safe bytes (256 bits of entropy).
- Keys are stored hashed server-side. The plaintext is shown exactly once at creation and cannot be recovered.
Getting a key
- Sign in at nokai.studio.
- Open API Keys -> New key.
- Give it a name (e.g.
production-server). - Copy the secret immediately.
Scoping
Every key belongs to a customer account -- the billing and isolation boundary. By default, a key can act on all resources under that account. You can also bind a key to a single channel by passing channel_id at creation -- useful for least-privilege service accounts.
See API reference -- API Keys for the create/list/revoke endpoints.
Key rotation
Issue a new key, update your environment, then revoke the old one. Both keys are valid during the overlap window -- no downtime.
- In the dashboard, open API Keys -> New key and copy the new secret.
- Update your environment with the new key and redeploy.
- Back in API Keys, revoke the old key.
Issuing and revoking keys requires a signed-in dashboard session -- an API key cannot create or revoke keys, so a leaked key can never mint itself a replacement.
Error responses
| HTTP | What it means |
|---|---|
401 | No Authorization header, or the key is invalid/revoked. |
403 | Key is valid but not permitted for this resource. |
Error body:
{ "code": 401, "msg": "Missing or invalid API key", "data": null }