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 path | POST /keys |
| Purpose | Create a key, optionally under a routing policy. The secret is returned once. |
| Authentication | Session only |
| Field | Meaning |
|---|
name | For you. Shown in Logs and Usage. |
project_id | The project the key belongs to. Defaults to the active project. |
policy_id | The routing policy to run under. Omit to inherit the default. |
callable_policy_ids | Optional. 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_content | Optional, default true. Whether Inferbase keeps this key's request content as a request log for up to 30 days. |
rate_limit_rpm | Optional requests per minute: at most 60 on the Free plan, 600 on Pro. A higher value is refused with 422. |
spend_cap_monthly_usd | Optional monthly spend cap. |
spend_cap_daily_usd | Optional daily spend cap (UTC day), at most the monthly cap. A higher value is refused with 422. |
expires_at | Optional expiry. |
{"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 path | GET /keys |
| Purpose | Your keys with the policy each runs under. Prefixes only. Scoped to the active project unless all_projects=true, which owners and admins may pass. |
| Authentication | API key or session |
Update a key
| |
|---|
| Method and path | PATCH /keys/{key_id} |
| Purpose | Change the name, the limits, or the routing policy. policy_id: null detaches the policy. |
| Authentication | Session only |
Revoke a key
| |
|---|
| Method and path | DELETE /keys/{key_id} |
| Purpose | Revoke the key. Cannot be undone. |
| Authentication | Session only |
Rotate a key
| |
|---|
| Method and path | POST /keys/{key_id}/rotate |
| Purpose | Issue 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. |
| Authentication | Session 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 path | Purpose | Authentication |
|---|
GET /credits | The organization's current balance. | API key or session |
GET /credits/transactions | Changes to the balance: top-ups, usage deductions, credit granted during the beta, and adjustments. | API key or session |
GET /usage | Usage logs with model, tokens, cost, latency, and status. | API key or session |
GET /usage/tags | The 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/export | The 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.