Skip to content

Agent definitions ​

A definition describes an agent; a version captures its configuration; an instance is the agent you can use. If your goal is to make an agent for your workspace, start with Create an AI agent. That guide uses the workspace API and avoids making you assemble these resources yourself.

All paths below are relative to https://api.chainabit.com/api/v1. These operations require a bearer session token and the applicable account, workspace, policy, and plan access. See Authentication.

Agent Definitions ​

MethodPathPurposeSuccess
GET/agents/definitionsList visible definitions200
POST/agents/definitionsCreate a definition201

List Definitions ​

limit defaults to 20 and is bounded to 1–100. offset defaults to 0 and cannot be negative. The response uses data for the collection and meta for limit, offset, total, and hasNextPage.

curl --fail-with-body -sS \
  "https://api.chainabit.com/api/v1/agents/definitions?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"

Create Definition ​

Use workspace agent creation for a complete, guided creation request. Its fields are specific to that operation; they are not a request schema for the lower-level definition operation.

Agent Versions ​

MethodPathPurposeSuccess
GET/agents/versionsList visible versions200

List Versions ​

curl --fail-with-body -sS \
  "https://api.chainabit.com/api/v1/agents/versions?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"

Keep the returned identifiers unchanged when using a version in another request.

Agent Instances ​

MethodPathPurposeSuccess
GET/agents/instances/availableDiscover accessible agents200
POST/agents/instancesCreate an instance201

Available Instances ​

Use discovery to find an agent your account can access. You can search by name or description with q, filter public visibility with is_public, and page with limit and offset.

curl --fail-with-body -sS --get \
  "https://api.chainabit.com/api/v1/agents/instances/available" \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "q=research" \
  --data-urlencode "limit=10" \
  --data-urlencode "offset=0"

Create Instance ​

The instance request uses these field names. Do not replace them with definitionId, versionId, or name.

FieldTypeNotes
agent_version_idUUIDOptional version to use
display_namestringOptional, up to 200 characters
memory_modestringtwin_linked or ephemeral; defaults to twin_linked
avatar_urlstringOptional, up to 2,000 characters
custom_system_prompt_varsobjectOptional variables for the version's system prompt
is_activebooleanOptional; defaults to true
is_publicbooleanOptional; defaults to false
scopestringworkspace or account; account scope requires an account owner or admin
max_turns_per_runintegerOptional, 1–100

The request's authenticated workspace context determines workspace ownership. An agent identifier does not grant access to a different workspace.

Agent Scopes ​

Create Scope ​

POST /agents/scopes creates a data-access grant for an owned agent version. This is distinct from the workspace/account ownership setting on an instance. For an ordinary workspace agent, follow the creation tutorial rather than copying an unrelated scope request body.

Agent Tools ​

Create Tool ​

POST /agents/tools registers a tool and returns 201. It requires tool-management permission in addition to authentication and plan access.

FieldRequiredDescription
keyYesUp to 200 characters; letters, digits, _, :, ., and -
display_nameYesDisplay label, up to 200 characters
descriptionNoUp to 2,000 characters
tool_schemaNoTool execution configuration object
is_activeNoWhether the tool is active

The workspace agent's toolIds field accepts registered tool keys, not tool record identifiers. A key must identify an active, accessible tool.

Next steps ​

Built with purpose. chainabit.com