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 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.
Authorizations
Issue from /v1/keys (or admin-issued for enterprise tier).
Headers
Body
Magic number (0..9223372036854775807) stamped on every order placed with this key that does not send its own magic. Give each bot its own key to tag its orders without code changes.
0 <= x <= 9223372036854776000Bot label (max 32 printable characters) stamped on every order placed with this key that does not send its own magic_label.
32Human-readable label
100Rate limit tier: free, pro, pro_plus, enterprise. Defaults to the tier your subscription or grant entitles you to. May be set lower than your entitlement; higher is refused.
Permissions: read, trade, admin
Response
Successful Response
Returned once on creation — the raw key is NOT stored.
Magic number (0..9223372036854775807) stamped on every order placed with this key that does not send its own magic. Give each bot its own key to tag its orders without code changes.
Bot label (max 32 printable characters) stamped on every order placed with this key that does not send its own magic_label.