API keys and spend
This page holds your provider credentials, the developer and agent keys issued from them, and each key's spend.

The three kinds of key
| Kind | What it is | Who holds it |
|---|---|---|
| Provider key | Your OpenAI, Anthropic, Gemini or other provider credential. Encrypted, one per provider per workspace, and added to each call by Forgebench. | Forgebench only. Your code never sees it. |
| Developer key | Issued to a person under one or more provider keys, one per provider. Each call uses the credential for its model's provider, and the key can call only those providers' models. | One developer, attributed by name. |
| Agent key | Belongs to one agent, never a person. An agent has one live key; asking for another rotates it. Rotation issues a new secret but keeps the same agent_id, so the agent's history carries over. | One Agent. |
A common setup is one provider key per provider, with a developer key per person or environment under it. Deleting a provider credential detaches it from its developer keys but doesn't delete them; a key that held several keeps the others.
A developer key can also be created without a provider parent. It then uses the workspace's configured credentials for its allowed catalog models. Listing workspace keys needs keys:view; creating, editing, and rotating needs keys:write; revoking needs keys:delete. Admins and owners have this access. Other members can open API Keys to see and reveal keys issued to them without permission to manage the workspace's keys.
Provider credentials
Provider keys live on the Credentials tab. Click Add credential to open Add a provider key. The Provider list offers every provider Forgebench supports, not only those in your model catalog. See Providers for what each one needs.
Each credential's ⋯ menu has Manage models, Show its keys (its developer keys) and Delete credential.
Choose which models developers can use
Manage models sets which of a provider's models developers can call
through that credential. Anyone with secrets:view can open it; only an admin or owner can save.
- Tick the models to enable. Enable all / Disable all act on the models shown. Filter by All, Enabled or Not enabled, or search.
- A second column shows what the provider reports for that key: Available to this key or Not available to this key. For Vertex it shows whether the model is In Model Garden, linking to the model's Google Cloud page.
- Click Save. With every model enabled, models Forgebench adds later are included too; with fewer, exactly the ticked list is saved.
The list applies to the model list, key creation and every call, including keys created earlier. With nothing enabled, developers can't call any model through that credential.
Caps and scope, per key
Every developer or agent key has its own:
- Daily and monthly spend caps (USD). Blank means no cap on the key; the workspace budget still applies. Edit caps here (the key's Manage drawer) or on Budgets.
- Model allowlist. Exact match against the catalog. An empty list denies every model; no list allows every catalog model.
- Scopes. What the key may call at all.
A leaked prototype key with a $5 daily cap, one cheap model and an explicit scope list is a contained incident.
Leaving Scopes blank doesn't narrow a key. An unscoped key inherits its owner's role bundle. To narrow it, set an explicit, smaller scope list. A key can never carry a scope its creator doesn't hold. One exception: a member whose custom role grants keys:write can give a key chat:write so it can call models. Custom-role callers must supply explicit scopes and can create, edit, rotate, or revoke only their own explicitly scoped keys.
A key you create in the console can call models only by default. To make a key for yourself that acts with your role, for example for a script that lists agents, check Same access as your role. The key then has no scope list and isn't limited to model calls. If you're an owner or admin, that key can manage API keys and SSO, so keep it as protected as your own login. The option isn't offered for keys made for someone else, templates, pools, or members with a custom role.
When a key's scopes are too narrow for a call, the 403 names the scope it
needs. Use a key with that access, or ask a workspace admin if you can't create
one.
The owner defaults to you. Admins and owners can select another eligible member. An unscoped key minted for a teammate inherits that teammate's role bundle.
Expiration
When you create a key, choose when it stops working: 7, 30, 60 or 90 days, a Custom date up to a year away, or No expiration. The form starts at 30 days. A key works through the end of its last day in your local time.
- An expired key is refused on every call with
401 {"detail":"api key expired"}. - A key with a fixed date can't be rotated or revealed once it expires, and its date can't be changed. Use Create a replacement in its ⋯ menu, then revoke the old key.
- A key made from a template, and an agent's key, expire after a length instead (for example 30 days). Rotating such a key gives it a fresh length, even after it has expired.
- An expired key keeps its name until you revoke it, so revoke it before reusing the name.
- The keys list says when a key expires within a week, and the page warns about keys that have expired or are about to.
A key template stores a length rather than a date, so it never goes stale: 7, 30, 60, 90 or 180 days, 1 year, or No expiration. Each key issued from it expires that long after it is issued. A new template starts at 30 days. Changing a template's expiration doesn't change keys it already issued. When Create key is filled from a template, its expiration fills in too.
Keys issued to people when you add them to a budget pool, or when they accept an invite, work the same way: a template brings its length, and Custom limits has its own Expiration (a length, starting at 30 days). An invite's key starts counting when the invite is accepted.
A request for a new key on Approvals has the same Expiration choice as Create key. If the date passes before someone approves it, approving fails and no key is made. Ask again with a new date.
Over the API:
POST /v1/auth/keys,POST /v1/keys/issueand a new-key approval request takeexpires_at, an ISO 8601 time with a timezone.POST /v1/key-templates,POST /v1/keys/issue,POST /v1/agents/registerand thenew_keysettings for budget pools and invites takeexpires_in_days(1 to 365).- Leave both out for a key that never expires.
Duplicate in a key's ⋯ menu opens Create key with that key's settings filled in; choose who it is for and give it a name. Keys for other people wait until you download or share them (see below).
The secret is shown once
Mint a key
Name it, set its caps and model allowlist, and for a developer key, tick its provider keys. Tick one per provider to let the key call several providers; with none ticked it uses the gateway's own credential. A key made for someone else, and a template, take a single provider key.
Copy the secret immediately
The
sk_...secret is shown once. Forgebench stores only a hash, so a lost secret can't be retrieved, only rotated.Rotate instead of losing access
Rotating issues a new secret for the same key. Its caps, scopes, allowlist and history stay the same; only your code's secret changes.
For a key issued to someone else and still waiting for reveal, only that owner can reveal or rotate it. This prevents an administrator from using rotation to retrieve an unrevealed personal secret.
Key templates
A template saves the settings most developers need, so you can make keys from it without filling in the form, or issue one key each to many people at once. See Key templates.
Change a key's models
Edit models in a developer key's row menu or inspector adds or removes the models the key may use, or switches it to all models. Only the model list changes: the secret, caps and rate limit stay as they are. If the key is routed through the CLI, run forgebench gateway refresh afterwards so Codex and Claude Code pick up the new list (see CLI reference).
The key form lists Forgebench's virtual auto/* models unticked. On a key with a model list, an auto/* model is available only when it's ticked: it's left out of /v1/models, and calling one that isn't ticked is refused with 403 model_not_allowed, like any other model. A key with no list (all models) keeps every auto/* model.
Find keys
On the Keys tab, the chips All, Developer, Agent and Revoked show one kind of key at a time. Filter by tag appears once any key has a tag. The search box matches key names, owners, tags, credentials and models. On Credentials it searches credentials and models.
Edit or revoke several keys
Tick rows on the Keys tab and a bar at the bottom shows how many are selected. Select all extends the selection to every key that matches your filters. Revoked keys and agent keys can't be edited. The review step lists what changes and what is skipped before you confirm.
Edit fields changes the same fields on every selected key. Each field is added, removed, replaced, set or cleared:
| Field | Notes |
|---|---|
| Tags | Add, remove, replace or clear. |
| Held by | Set a member as the key's owner, or clear it. |
| Daily cap, Monthly cap | USD. Can't exceed the workspace's limits, and the daily cap can't exceed the key's monthly cap. |
| Daily token cap, Monthly token cap | Whole tokens. Clear to remove the cap. |
| Rate limit | Requests per minute for each key. Cleared, only the workspace's own limit applies. |
| Allowed models | Add, remove, replace or clear. Add and remove change only keys that already have a list. Replace limits every key to the chosen models. Clear lets a key use every model, or every model of its credential. |
| Credential | Set or clear the provider credential. A key with a credential can only use that provider's models, so its model list resets to all of them. |
Revoke stops the keys working right away and can't be undone. An agent's own key is skipped.
Spend, broken down by key
Every call is attributed to its key. You can see which developer key spent most this month, which provider key dominates the bill, and which agent key is nearest its cap. The numbers match Budgets; both read the same ledger.

