API keys

Create the Secret, Agent and Client API keys your website, apps and servers use to reach your agents, and keep them safe.

UPDATED NOVEMBER 23, 20262 MIN READ

API keys let software outside the Playground reach your agents: the web widget on your site, your app, your servers. There are three kinds, each for one job. Manage them under Organization > API Keys in the side rail.

These are keys to your agents. Credentials your agent uses to call your systems are different: they live in the agent's vault.

#The three kinds

KindBelongs toUse it forWhere it may appear
Secret API KeysYour organizationBackend services, scripts, automation and CI pipelines that manage workspaces, agents, branches and threads through the API.Server side only.
Agent API KeysOne agentBackend services and integrations that act on behalf of one agent, such as your systems sending it events.Server side only.
Client API KeysOne agentConversations from websites, the web widget, your apps, and the messaging test. They reach the agent's live commit.Safe in web pages and app code.

The developer docs call Secret API keys organization API keys and Client API keys publishable keys. For how each key is exchanged for access and which requests accept it, see Authentication.

#Create a key

  1. Open Organization > API Keys and pick the kind of key on the left.
  2. Click Add key.
  3. In Name, say where the key will be used, such as "ACME website widget".
  4. For an Agent or Client key, choose the Agent. Project (optional - filter agents) narrows the list to the agents of one workspace. A Client key can also have a Description.
  5. Confirm. The new key is shown; copy it to the system that will use it.

If Add key is unavailable, your role can't create API keys. Ask an organization administrator.

Each kind of key has its own list.

#Manage keys

Each list shows the keys' names, the masked keys, what they belong to, when they were created and their status. From a key's row you can:

  • copy the key;
  • Show key to see the full key again (organization admins and owners);
  • Edit key to change its name, or a Client key's description;
  • Deactivate key to stop an Agent or Client key working without deleting it, and Activate key to turn it back on;
  • Delete key to remove it for good, after a confirmation.

#Keep keys safe

  • Never put a Secret or Agent API key in a web page, a mobile app or a code repository. Keep it in your server's environment variables or secrets manager.
  • Give each system its own key, named after it, so you can turn one off without breaking the others.
  • If a key may have leaked, deactivate or delete it, create a new one, and update the system that used it.
  • Delete keys you no longer use, Client keys included.

Was this article helpful?