Create a new API key
Mints a new API key in the workspace, bound to the single project in projects or to every project when omitted. The raw token is returned once in the token field and is never retrievable afterwards. Unknown body fields are rejected.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Display name of the key.
100Per-domain access level (none, read or write) for restricted keys; domain ids come from the capability catalog.
Expiry and other limits applied to the key.
Legacy expiry as an RFC 3339 timestamp; prefer constraints.expires_at.
Lifecycle binding: a user-owned key is revoked with the user, a service-account key outlives any user.
Permission preset; restricted keys hold only the domains granted in access.
all, restricted, read_only Projects the key may reach: every project of the workspace or a single one.
Legacy single-project binding; prefer project_scope.
1Origin of the key; router keys are minted for the AI router.
workspace, router Response
The created API key with its raw token
Unique identifier of the key.
Display name of the key.
The raw secret on create only; a masked display value everywhere else.
Workspace the key belongs to.
all, restricted, read_only active, disabled, revoked Display prefix of the secret; not usable as a credential.