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 reference › Keys and usage
On this page
  1. API keys
  2. Create a key
  3. List keys
  4. Update a key
  5. Revoke a key
  6. Rotate a key
  7. 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.
callable_policy_idsOptional. Other routing policies a request may run under by sending model: "policy:<slug>" with this key; at most 20, each attachable as policy_id is. PATCH /keys/{key_id} replaces the list.
log_request_contentOptional, default true. Whether Inferbase keeps this key's request content as a request log for up to 30 days.
rate_limit_rpmOptional requests per minute: at most 60 on the Free plan, 600 on Pro. A higher value is refused with 422.
spend_cap_monthly_usdOptional monthly spend cap.
spend_cap_daily_usdOptional daily spend cap (UTC day), at most the monthly cap. A higher value is refused with 422.
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

Rotate a key

Method and pathPOST /keys/{key_id}/rotate
PurposeIssue a new secret for the same key: same id, project, policy and usage history. The old secret keeps working for 24 hours so production can switch without downtime, then stops.
AuthenticationSession only

The response has the same shape as creating a key, with the new secret returned once. The portal does the same 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, credit granted during the beta, and adjustments.API key or session
GET /usageUsage logs with model, tokens, cost, latency, and status.API key or session
GET /usage/tagsThe tag keys your requests carried in a window, most used first.API key or session
GET /usage/by-tag?key=Requests, tokens and cost grouped by one tag's values; untagged requests as their own group.API key or session
GET /usage/exportThe same rows as CSV under the same filters, oldest first, at most 50,000 (X-Export-Truncated: true when cut).API key or session

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

Last updated October 9, 2026.