Skip to content
会nokai.studio

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

  1. Sign in at nokai.studio.
  2. Open API Keys -> New key.
  3. Give it a name (e.g. production-server).
  4. 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.

  1. In the dashboard, open API Keys -> New key and copy the new secret.
  2. Update your environment with the new key and redeploy.
  3. 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

HTTPWhat it means
401No Authorization header, or the key is invalid/revoked.
403Key is valid but not permitted for this resource.

Error body:

{ "code": 401, "msg": "Missing or invalid API key", "data": null }