Skip to main content
Docs · API reference

Keys and usage

Manage API keys, and read the balance, transactions, and usage logs from the API.

Browse docs · API referenceKeys and usage
On this page
  1. API keys
  2. Create a key
  3. List keys
  4. Update a key
  5. Revoke a key
  6. Credits and usage

API keys

A key runs under the routing policy attached to it, else the project default, else the organization default, else the Inferbase default. A key carries no routing settings of its own; a request that sets model_pool, optimize_mode, preset, or auto_scope on a key is refused.

Creating, updating, and revoking keys require a signed-in session. An inf_ key cannot manage keys, so a leaked key cannot mint another or revoke yours. Listing works with either.

Create a key

Method and pathPOST /keys
PurposeCreate a key, optionally under a routing policy. The secret is returned once.
AuthenticationSession only
FieldMeaning
nameFor you. Shown in Logs and Usage.
project_idThe project the key belongs to. Defaults to the active project.
policy_idThe routing policy to run under. Omit to inherit the default.
rate_limit_rpmOptional requests per minute.
spend_cap_monthly_usdOptional monthly spend cap.
expires_atOptional expiry.
json
{"name": "Production", "policy_id": "6d1c1f2e-0b7a-4c3e-9f1a-2b3c4d5e6f70"}

The response carries key, the full secret, once. Store it; only key_prefix is shown afterwards.

List keys

Method and pathGET /keys
PurposeYour keys with the policy each runs under. Prefixes only. Scoped to the active project unless all_projects=true, which owners and admins may pass.
AuthenticationAPI key or session

Update a key

Method and pathPATCH /keys/{key_id}
PurposeChange the name, the limits, or the routing policy. policy_id: null detaches the policy.
AuthenticationSession only

Revoke a key

Method and pathDELETE /keys/{key_id}
PurposeRevoke the key. Cannot be undone.
AuthenticationSession only

Rotation, which issues a new secret while the old one keeps working for 24 hours, is done in the portal under Gateway › API keys.

Credits and usage

Method and pathPurposeAuthentication
GET /creditsThe organization's current balance.API key or session
GET /credits/transactionsChanges to the balance: top-ups, usage deductions, the welcome credit, and adjustments.API key or session
GET /usageUsage logs with model, tokens, cost, latency, and status.API key or session

The same data is shown under Observability › Usage and Settings › Billing.

Last updated September 10, 2026.