Who: on Enterprise, Admins; on SaaS, Admins and Members on the Pro and Business plans · Where: Integrations › API keys in the sidebar · Works on: Enterprise and SaaS (not the SaaS Free plan)
Create an API key
1
Open API keys
Open API keys in the sidebar and select Create API Key.
2
Fill in the form
- Name: unique in your organization, 3 to 100 characters, using letters, numbers, hyphens and underscores, for example
production-backendorci_pipeline. - Description: optional, up to 500 characters, to remember what the key is for.
- Permissions: at least one. They decide what the key can reach; see Permissions.
- Microsoft Teams bot key (Enterprise, Admins only): turn it on only for the one key your organization’s Microsoft Teams bot uses, and leave it off for every other key. See Microsoft Teams.
3
Copy the secret
The Copy your secret key now dialog shows the full secret once. Copy it with the copy button, store it somewhere safe, then select I have saved the key. The secret can’t be shown again. If you lose it, create a new key.
Change, turn off or delete a key
- To change a key, select it or its pencil icon to open Edit API Key. You can rename it, change its description or permissions, set or clear Microsoft Teams bot key (Enterprise, Admins only), and turn it off with Active Status. Select Save Changes. A key you turn off stops working within seconds, and you can turn it on again later.
- To delete a key, select the trash icon on its row and confirm in Delete API Key. A deleted key stops working within seconds, and any application that still uses it gets authentication errors.
Permissions
A new key starts with Chat ticked. Only an Admin can give a key Users, Groups or Admin; a Member doesn’t see them. A call outside the key’s permissions is refused with
403. No key can create or change other keys.
Who sees which keys
- Enterprise: Admins manage keys, and an Admin sees and manages every key of the organization.
- SaaS: Admins and Members on Pro and Business manage keys. On Business, an Admin sees and manages every member’s keys, and a Member creates and sees only their own. The Free plan has no API keys: API keys isn’t in the sidebar, opening the page sends you to Subscription to upgrade, and a call made with a key on the Free plan is refused.
Use a key in your application
Your program trades the key’s secret for a token atPOST /apikeys/token, then sends the token as a Bearer token in the Authorization header. The examples use the SaaS address. On Enterprise, use your organization’s own API address.
- Enterprise: any published agent of the key’s organization.
- SaaS: the agents its creator may use.
POST /chat starts a run and returns a handle at once. You then poll it, stream it, or receive the result by webhook. The durable-run model explains the request format and the three ways to collect a result, and the API reference lists every endpoint.
A key with no organization
A key with no organization
A key made on a SaaS personal account belongs to no organization. It can’t manage users or groups, whatever its permissions.
Good habits with keys
Good habits with keys
- Make a separate key for each application or environment, with only the permissions it needs.
- Rotate keys: create a new key, move your application to it, then delete the old one.
- Turn off or delete a key at once if it may have been exposed.
- Send an
idempotency_keywhen you retry a request. A retry after a network error then re-attaches to the original run instead of starting, and billing, a second one. - Expect
429answers. Keys have the same limits on runs at the same time as the web app, counted against the key’s creator. Wait for the time given inRetry-Afterbefore you retry.