API Keys
An API key lets a customer call the panel's API from a script, a CI pipeline, or another program — without logging in through a browser each time. The key travels as a Authorization: Bearer … header and authenticates the request on behalf of the customer's organization.
Keys are managed entirely in the UI (Portal → API Keys). There is no terminal step.

What makes a customer key different
The panel supports API keys for operators and org-scoped customer keys with three properties an operator key doesn't have:
- They belong to the customer's organization, not just the user who created them. A key bound to a customer's organization reads the secrets of that customer on the Secrets API, so the key pages are guarded like secrets. A login needs the view secrets right on the customer's organization to see the list of keys, and manage secrets to create, reveal or revoke one. The default customer login (the built-in Customer role) has both. A read-only member (the
Userrole) or a member of a single project has neither: the API Keys entry is not in their menu, and a direct link shows that their role does not allow it. Revoking also needs manage secrets, even while the feature is switched off. On top of that, the list, reveal and revoke show a key only to someone who holds every permission of that key's role in the organization, the same rule as creating one. A member whose role has view secrets but not the whole Customer role sees the page with no keys on it. An API key with a deny list is compared by what it may do: it sees a key whose deny list is the same as its own or longer, and not one that may do something it is denied (the same comparison as reveal). - They are stored in the secrets manager (OpenBao), in the customer's own compartment — so the panel can show the full key again later (an audited reveal), not just once at creation. Only keys with the Customer role keep this copy: a key with a stronger role is shown once, when it is created.
- They are gated by a capability. An operator turns the
api_keyscapability on or off per plan or per customer. When it's off, the customer can't mint keys and any key they already have stops authenticating immediately — no redeploy, no restart.
Think of it like the key to a rented unit: the building manager (the operator) can revoke access to the whole unit at any moment, and the moment they do, the tenant's key stops opening the door — even though the physical key still exists.
What a key can reach
On the REST API (/api/v1), a key works for the organization it belongs to and the organizations below it, with the permissions of the key's own role there. Keys created in the portal carry the Customer role: services, projects, secrets, usage, and the portal pages. Everything outside the key's organization answers 404, exactly like something that doesn't exist. What the key's creator may do elsewhere adds nothing, and a key is never stronger than its creator is now: it has the permissions of its role that its creator also holds in the key's organization or one above it. If the creator's role there is lowered, the key is cut down with it on the next request. If they are removed from the organization, the key keeps its own role: it belongs to the organization, not to the person. Removing a person does not revoke their keys. Revoke them on the Keys page. A key is never a platform key, and it can create, list and revoke only keys of its own organization. A key whose deny list includes manage secrets cannot list or revoke keys through /api-keys (it gets 404, the same answer as for anything it may not do) and cannot create, reveal or revoke keys through the portal. It can still see key names and prefixes, never secrets, in the portal's key and MCP token lists; whether that should change is a separate policy decision (AI-1304). Organization branding is not part of the Customer role, so a portal key cannot change it; use the browser. A key also cannot touch the account of the person who created it: the profile, password, sessions, two-factor settings and logout routes (/account/…, /auth/totp/…, /auth/logout) answer 404 to a key. GET /auth/me still answers, so it stays a good first test of a new key.
The Secrets API and the portal routes follow the key, too. On /secrets, /secrets/versions, /secrets/reveal and the portal routes (/portal/…, including the portal key and MCP token lists, reveal and revoke) a key acts for the customer of the organization it belongs to, never for another customer its creator is a login of. If the creator is a login of two customers, a key that belongs to one of them reads that one's secrets and portal and is refused on the other's.
A key made by staff above the customer. A key that belongs to a customer's organization and was created by someone whose role comes from above it (an Admin of the customer's reseller, or a member of the platform organization) reaches that customer's portal routes with the Customer role, although its creator is not a login of the customer. It stops working on the next request after its creator loses that role. Revoke the key to cut it earlier.
On the MCP endpoint, a token reaches only its organization's own services, never the organizations below it. See MCP.
An operator who edits the Customer role changes what every customer key may do, because keys use the role as it is defined at the time of each request.
While the customer is suspended, its keys are refused. Every /api/v1 request with a key of a suspended customer, reads included, answers 403 with the message "the customer is suspended". This covers a key that belongs to the customer's organization, whoever created it, and the personal key of any login of the customer. The keys are blocked, not revoked: when the operator reactivates the customer, the same keys work again. See Suspend and reactivate.
Who can create a key
A key is issued only to someone who holds, in that organization, every permission of the key's role. Portal keys and MCP tokens carry the Customer role, so:
- A customer login with the default role, the Customer role or the Admin role can create keys.
- A member with a weaker role (for example the read-only User role, or a role on a single project) is told their role doesn't allow it. Give them the Customer role under Organizations → Users, or have another member create the key.
A key is never stronger than its creator is now. On every request the panel checks what the key's creator holds in the key's organization, and the key gets the permissions of its role that the creator still has:
- Lowering the creator's role weakens their keys at once. Change a member from the Customer role to the read-only User role and a key they made loses, for example,
GET /secrets,GET /secrets/versions,POST /secrets/validate-refand reveal. The key is not revoked. It still signs in and answers404on what it lost. It can also no longer create keys or MCP tokens: that answers403with the codeinsufficient_role. - Giving the role back restores the key. Nothing has to be created again.
- Raising the creator's role adds nothing. A key never does more than its own role.
- Removing the creator keeps the key working. When a person's last membership on the key's organization (or an organization above it) is removed under Organizations → Users, on the user's role list or from a project, their keys there keep the permissions of their own role, minus anything the key was created without. Removing a person does not revoke their keys: when someone leaves, revoke the keys they created on the Keys page. A key keeps working only in the organization it was made for: if that customer is later moved under another reseller, it stops (
404) and a member creates a new one. Keys of people removed before this update stay restricted; re-create them.
This applies to the permission-checked REST routes, the /portal/* routes included, and to every platform-only route. Each platform-only route (templates, Git deploy and analysis, AI runtimes, backups, settings, licence, GitHub App and the rest) names one permission, and a platform key whose deny list contains it gets 404 there, as on any other route. A key without a deny list loses nothing. The Assistant's own routes are the exception: each action it runs is checked against the key's deny list instead. On the MCP endpoint a token does not follow its creator's role, but it honours its own deny list: a tool that needs a denied permission is refused (see What a token is refused). A platform key on the admin MCP endpoint is held to its deny list the same way, for every tool (see What a key is refused). To cut a token completely, revoke it.
How fast it takes effect. Changing which role a member has, or removing them, reaches their keys on the next request. Editing what a role contains (adding or removing a permission of the role the creator holds) can take up to 30 minutes to reach the key, because resolved permissions are cached for that long.
Before you lower someone's role, check which integrations run on keys they created, and have a member who keeps the Customer role create a replacement.
Keys that existed before the mint rule shipped were adjusted on upgrade so that none became stronger: a key whose creator held less than the Customer role got the missing permissions added to its deny list. That adjustment is permanent for the key, even if its creator is given the Customer role later. It applies to MCP tokens on the MCP endpoint too. To give such a key the full role, revoke it and have a member with the Customer role create a new one.
A key's deny list carries over to keys it creates
An API key with a deny list (for example "everything except users.update") that creates another key passes that list on: the new key is denied at least the same permissions, plus any it asked for. A key denied secrets.manage cannot create keys at all. Without this, a restricted key could mint itself an unrestricted one, like a sudoers rule that forbids one command but allows sudo su. Keys that were created before this rule keep the list they were given; review keys made by restricted keys (AI-1187).
Creating and using a key (customer)
Open Portal → API Keys.
Click Create key, give it a name (e.g. "CI deploy"), and pick an expiry: 30 days, 90 days (the default), 1 year or never. Never shows a warning: a key that never expires keeps working until you revoke it, even if it leaks or is forgotten.
The full key is shown once, in the format
aap_XXXXXXXX_YYYYYYYYYYYYYYYY. Copy it now — for security it is not shown again automatically.
Send it as a bearer token:
curl -H "Authorization: Bearer aap_XXXXXXXX_YYYYYYYYYYYYYYYY" \
https://your-panel.example.com/api/v1/auth/me
If you lose a key created after org-scoped keys shipped, you can Reveal it again from the same page (this is recorded in the audit log). If you need to retire a key, Revoke it — anything using it stops working immediately. You can always revoke, even if the operator has since turned the capability off.
Why the page might be locked
If your provider hasn't included API keys in your plan, the page shows a locked card explaining why:
- "disabled by your administrator" — the operator turned the capability off globally or suspended the account.
- "not included in your plan" — API keys aren't part of your current plan; ask your provider to enable them.
Any keys you created earlier stay visible so you can still revoke them.
Admin keys in Settings
The operator creates keys for the admin API under Settings → Security → API Keys. Create key asks for:
- Name, so you can tell keys apart later, for example "CI/CD pipeline".
- Role: Admin or Customer. The key gets the permissions of that role.
- Requests per minute: the key's rate limit. The default is 60.
- Expiry date. Leave it empty for a key that never expires.
The full key is shown once, right after you create it. Copy it immediately: the panel does not show it again. To retire a key, click the bin icon next to it and confirm; anything using it stops working.
The Approvals column has the switch Run high-risk tools without approval. It is off for every key: an AI client using the key over MCP must wait for an admin on the Approvals page before it runs a command or edits a file in a service, restores or deletes a backup, and the other high-risk tools. Turning it on lets that key's client run them at once, so the client's own permission prompts become the only safeguard; the panel asks you to confirm first. Set up the client before you turn it on: Recommended MCP Client Configuration.
Enabling API keys (operator)
api_keys is a capability, resolved through the same cascade as the other capabilities (see Secrets Manager for the wider secrets story):
- Global switch — Settings → AI → Capabilities. Off beats everything.
- Plan default — a plan may include
api_keysand set an optional max keys limit. - Per-customer override — enable, disable, or set a different max-keys limit for one customer.
The resolution order is: active subscription → global switch (off wins) → per-customer override → plan default → default off. A key minted by a customer authenticates only while the resolved answer is on; flip it off and the key returns 401 on the very next request.
The max keys limit caps how many active (not revoked, not expired) keys an organization may hold. Leave it blank for unlimited.
Upgrading — read this first
The upgrade migration adopts existing customer-role keys into their organization and gates them on the api_keys capability, which defaults to off. That is deliberate (secure-by-default), and it has one consequence you must plan for:
After upgrading, any existing customer API keys stop authenticating until you enable the
api_keyscapability (through the global switch and the relevant plan/customer settings). Operator/admin keys are unaffected — they are never capability-gated.
Enable api_keys where you want those keys to keep working, in Settings → AI → Capabilities and/or on the relevant plan.
Re-reveal is only for keys minted after the feature shipped
Keys created before org-scoped keys shipped were never stored in the vault — only a one-way hash of them is kept — so their plaintext genuinely cannot be recovered. Revealing such a key returns a notice telling you to rotate it instead: revoke it and create a new one. Reveal also depends on the key remaining eligible and its vault entry being available; it is not a recovery mechanism for a missing vault.
A restricted key cannot reveal a stronger one
Revealing a key hands over everything that key may do, so the caller must be at least as strong. When an API key with a deny list calls Reveal (POST /api/v1/portal/api-keys/{id}/reveal) on a key that may do something the caller is denied, the answer is 404, the same as for a key that does not exist, and no secret is returned. A key with the same deny list, or a longer one, can still be revealed, and a deny entry outside the key's role makes no difference. Browser sessions and keys without a deny list reveal as before (AI-1271). The same rule covers MCP tokens; see MCP.
What's recorded
Minting, revealing, and revoking a key each write an audit-log entry (api_key.create / api_key.reveal / api_key.revoke) with the key's name and prefix — never the key material itself. The full value is returned at creation and on an authorized Reveal. Treat both responses, copies and clients using the key as sensitive. Vault storage does not protect the value from an administrator with host access.