z_sk_...) belong to an organization. Create your first key in the Developer console. Owners and admins can enable Admin access to provision a key that manages other keys through the API.
Permissions
For all three management endpoints, the calling API key must haveadmin: true, and its owner must still be an owner or admin of the organization. An ordinary inference key cannot manage keys. An OAuth bearer with cli:inference can also manage keys when its user is a current owner or admin. Browser cookies alone do not authenticate these endpoints.
Send Authorization: Bearer or X-API-Key. The credential determines the organization; an optional X-Org-ID must match it. You cannot select another organization in the request body.
Create a key
201 with the secret nested under key.token:
New keys have independent expiry and spend-cap settings; they do not inherit the calling key’s limits. Daily and monthly caps reset at their UTC window boundary. An overall cap expires the key when exhausted.
List keys
200 returns {"keys":[...]}. Each entry includes id, name, status, created_at, and admin, with optional expiry, last-use, revocation, and spend-cap metadata. Status is active, expired, or revoked. Listing never returns secrets or hashes.
Revoke and rotate
Create a replacement key, update your application, then revoke the old key:204 with no body. Revocation is immediate and permanent and preserves accounting history. A missing, already revoked, or other organization’s key returns 404. Revocation does not require a funded balance.
Related
Administrative balance reads
Keys withadmin: true can also call GET /api/v1/billing/balance, while their owner remains an organization owner or admin. Ordinary keys can inspect request-rate capacity without admin permission.
