Skip to main content
The Kynva API authenticates every request with a bearer token in the Authorization header:
There are two kinds of token. Pick based on who is making the call:
Never put an API key in browser, mobile, or desktop client code. API keys grant full access to your workspace. If you need to call Kynva from a user’s device, mint a JWT on your backend and forward that.

Method 1 — API key (Bearer)

API keys live in Settings → API Keys. Each key has:

Send the key

Rotate a key

  1. In the dashboard, click Rotate on the key you want to replace.
  2. The new key is shown once. Update your secrets store immediately.
  3. The old key keeps working for a 24-hour grace window. After that it returns UNAUTHORIZED.
Schedule a quarterly rotation. Kynva sends an email reminder at the 80-day mark for any key older than 90 days.

Store keys safely

  • Backend: load from your secret manager (AWS Secrets Manager, GCP Secret Manager, Doppler, 1Password Connect). Never commit to git.
  • Local dev: use a .env file ignored by git, or your shell’s keychain.
  • CI: provision as a masked secret in GitHub Actions / GitLab CI / etc.
If a key leaks, rotate immediately. The dashboard shows last-used timestamp and source IP — use both to audit blast radius.

Method 2 — JWT (end-user, short-lived)

If your product makes Kynva calls on behalf of an end user (e.g., a browser app where the user pays per render), use JWTs instead of API keys.

How it works

  1. Configure your JWT issuer in Settings → Auth — issuer URL + JWKS endpoint.
  2. Your backend mints a JWT for the requesting user. Include:
    • sub — the user’s stable ID in your system
    • aud: "kynva"
    • exp — short. 5–15 minutes is typical.
  3. Pass the JWT as the bearer token.

Send the JWT

JWT requirements

Tokens with missing or invalid claims are rejected with UNAUTHORIZED.

Verifying a request succeeded

A successful authenticated request includes:
A failed authentication request returns:
See error codes for the full taxonomy.

Frequently asked

No. Legacy rf_* keys keep working indefinitely. New keys are issued with the kyn_ prefix. Nothing about the wire protocol changed.
Yes. In the dashboard, edit a key and add brand:brand_abc to its scope. The key will return FORBIDDEN if used against any other brand.
Yes. Same backend, same code, but renders made with a test key are watermarked and don’t consume credits.
Limits apply per workspace, not per key. See Rate limits for the per-category caps.