Skip to main content
API keys (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 have admin: 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

A successful creation returns HTTP 201 with the secret nested under key.token:
Store the returned secret securely: it is shown only once. Creation requires API-console eligibility and funding. 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

HTTP 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:
Success is HTTP 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.

Administrative balance reads

Keys with admin: 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.