Skip to content
会nokai.studio

API keys

nokai.studio uses bearer tokens for API authentication. See Authentication for the header format and rotation runbook.

Key format

zpk_live_abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGH
  • Prefix zpk_live_ is a hint for tooling; the API does not gate features by prefix.
  • 32 random URL-safe bytes (256-bit entropy).
  • Stored hashed server-side. The plaintext is shown exactly once at creation.

Lifecycle

  1. Issue -- POST /v1/api-keys with a name. Get back the key metadata plus secret (once-only).
  2. Use -- put the secret in Authorization: Bearer ....
  3. Rotate -- issue a new key, update your environment, then revoke the old key.
  4. Revoke -- DELETE /v1/api-keys/:id. Takes effect immediately.

Scope

Every key belongs to a customer (the billing account). By default, a key can act on all resources. You can restrict a key to a single channel (channel_id on creation) for least-privilege isolation.

Viewing keys

GET /v1/api-keys returns key metadata (prefix, name, last used, expiry) but never the raw secret.

Rate limits

Every authenticated request consumes one token from a per-customer bucket. Check current headroom with GET /v1/limits -- it is free (does not consume a token).

See Reference -> Rate limits for bucket sizes and headers.