Create API key
Creates a new API key for an account.
Endpoint
POST /api/v1/api-keys
Authentication
Signing material is carried in the X-PUBLIC-KEY (base64 ed25519 pubkey), X-SIGNATURE
(base64 ed25519 signature), and X-REQUEST-ID (UUIDv7) headers — see [SessionSigAuth].
Signed message: request_id (16) || account_id (8 LE) || subaccount_or_max (4 LE) || key_name.
request_id’s embedded timestamp must fall inside the OG’s skew window.
SubaccountIndex::MAX is the wire-format sentinel for unpinned (admin-scope) keys.
Returns
200 OKwithCreateApiKeyResponsecontaining the raw API key (returned once).400 Bad Requestif the key limit is reached, the payload is malformed, a signing header is malformed, or therequest_id’s embedded timestamp falls outside the skew window.401 Unauthorizedif a signing header is missing, signature verification fails, the session key is invalid/expired, or the session lacks the scope to mint at the requested subaccount.404 Not Foundif the target subaccount does not exist.500 Internal Server Errorif an internal error occurs.
Authorizations
Base64 ed25519 session public key. Part of the SessionSig triple; not an API key.
UUIDv7 replay nonce; its embedded timestamp must fall inside the skew window [now-15s, now+5s]. Part of the SessionSig triple.
Base64 ed25519 signature over the canonical request message. Part of the SessionSig triple.
Body
Request payload for creating a new API key. subaccount_index is None for an admin-scope
(unpinned) key and Some(idx) for a subaccount-pinned key. Signing material lives in the
X-PUBLIC-KEY / X-SIGNATURE / X-REQUEST-ID headers ([SessionSigAuth]);
deny_unknown_fields rejects stray JSON fields. A legacy client that omits the new headers is
rejected with a missing-header 401 by SessionSigAuth (extracted before the body), not a 400.