Skip to main content
An API key lets one of your own applications use Neural Factory through its REST API, for example a script that asks an agent for a report every night. You create keys, change them, turn them off and delete them on the API keys page.
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-backend or ci_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.
Select Create.
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.
Keep the secret out of version control, chat messages and code that runs in a browser.
A key acts for the person who created it. Its runs, its usage and its limit of runs at the same time count as theirs. It stops working when its creator’s account is deactivated, or when they leave the organization or lose their seat.

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.
Viewers can’t manage keys. The list shows the keys you can manage. You can search it with Search API keys… and sort its columns:

Use a key in your application

Your program trades the key’s secret for a token at POST /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.
The token lasts 24 hours. A key that is inactive, or whose creator has lost access, gets no token. Which agents a key can call:
  • Enterprise: any published agent of the key’s organization.
  • SaaS: the agents its creator may use.
An agent that was never published can’t be called. What a key does appears in Interactions, under the key’s name. 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 made on a SaaS personal account belongs to no organization. It can’t manage users or groups, whatever its permissions.
  • 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_key when 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 429 answers. 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 in Retry-After before you retry.