API Keys
Create Key
Generate a new API key.
The raw key is returned ONCE in the response. Only the SHA-256 hash is stored in the database.
Closed-beta gating (CLOSED_BETA_MODE=true, default): only users
who already hold an ACTIVE admin-issued key — i.e. cohort members
admitted via POST /admin/api-keys/issue or
/admin/api-keys/issue-beta — can self-service additional keys.
Admins themselves bypass the gate. A waitlisted user with no key
yet receives a 403 CLOSED_BETA envelope pointing at the apply URL.
POST
Create Key
Authorizations
Issue from /v1/keys (or admin-issued for enterprise tier).
Headers
Body
application/json
Previous
Bootstrap first API key via Bearer JWT (advanced / headless)Create your **first** API key using a Supabase Bearer access token. Most users don't call this endpoint directly — the dashboard at [polysimulator.com/api-keys](https://polysimulator.com/api-keys) handles the JWT exchange transparently.
This endpoint exists for headless / CI setups where there's no browser session: `POST /v1/keys` requires an existing `X-API-Key`, but a fresh user has no key yet.
**Auth:** `Authorization: Bearer <supabase_access_token>` from a programmatic Supabase sign-in. Verified HS256 against `SUPABASE_JWT_SECRET` with `audience="authenticated"`; expiry and `sub` UUID enforced.
**Limits:** 1 call/minute, 5 calls/hour per IP — real users only bootstrap once per account. Returns `400 BOOTSTRAP_NOT_ALLOWED` if you already have API key(s); use `POST /v1/keys` for additional keys.
Next
Create Key