Skip to main content
An API key can create and manage agents, the same way an admin does on the Agents page of platform.cominty.ai. A custom agent runs like Hive, with the capabilities, instructions, and models you give it. Pass its id as the agent id of any chat call. This page works for the Python SDK, the JavaScript SDK, and HTTP. Each snippet has a tab for each. Both SDKs have the same methods on client.agents. The names that differ:

What an API key can do

The key acts as an admin of its own organization. This frames every resource of this guide, and of Skills and Sources. Everything the key creates is owned by the user who created the key. The agent’s owner is that user’s id, not the key’s. Call that user the key owner.
A key is powerful. It can edit and delete the organization’s agents, and it can change a built-in agent’s model chain for every user. Store it like a password.

Find the values you need

An agent refers to integrations and models by id. Read them from the API.
  • A server’s name is the value to store in the connections of the MCP capability. By default, mcp.list() keeps only the integrations that are turned on. Set enabled to null to see every server. See client.mcp in the Python SDK and JavaScript SDK references.
  • requires_oauth_connect is true when someone must connect the integration with OAuth in the console first. See MCP integrations.
  • A model’s id goes in the agent’s model chain.

Create an agent

The reply is the full agent:
  • scope is "private" (the key owner only, the default) or "organization" (every member).
  • A capability you do not set gets its default, here memory: never. Over HTTP, the capabilities you did not set come back as null. The SDKs leave them out.
  • Omit the model ids to use the organization’s default model chain.
  • capabilities.memory sets the agent’s memory namespace. The older execution_options and memory_namespace fields are deprecated, and the SDKs do not accept them.
  • Capabilities work as on a thread. See Capabilities. The agent’s capabilities are the saved default of the first of the three layers.

Chat with it

Use the id like any other agent.
An MCP server is mounted on the agent as a sub-agent. The message’s tool calls show a subagent call, not the integration’s tool names. To turn MCP off for one message, send a message scope that sets mcp to enabled false. See Keep some connections, or none.

Update an agent

An update is partial: send only what you want to change.
  • A null value (None in Python, null in JavaScript and HTTP) clears description, instructions, and capabilities.
  • capabilities is merged capability by capability. Each capability you send replaces the stored one, and the others stay. In the example, web changed and mcp was kept.
  • You cannot clear name, scope, or the override flag. The SDKs raise InvalidParams for a null value there, and for an update with no argument.
  • An organization agent owned by someone else can be updated and deleted with the key.

Choose the models

An agent has a model chain. The first model answers, and the next ones take over when it fails.
  • An unknown id returns 404 with detail Bad model_ids. An empty list returns 422. The SDKs raise InvalidParams for an empty list, before any request.
  • The model ids on create set the chain at creation. Omit them for the organization’s default chain.
On a built-in agent, such as Chat or Hive, setting the model chain changes it for the whole organization. It affects every user. The built-in agents cannot be edited or deleted otherwise.

Read and delete

list returns the built-in agents (managed is true), the organization agents, and the key owner’s private agents. A private agent of another member is not there, and get, update, and delete on it return 404. A delete is permanent. The messages the agent handled keep working, and report their agent as "ARCHIVED".

Errors

For the error classes, see the Python SDK reference and the JavaScript SDK reference.

Next steps

Skills

Upload a skill and give it to an agent.

Sources

Index local files and let an agent search them.