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
| Method | Path | Purpose | Success |
|---|---|---|---|
| GET | /agents/definitions | List visible definitions | 200 |
| POST | /agents/definitions | Create a definition | 201 |
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
| Method | Path | Purpose | Success |
|---|---|---|---|
| GET | /agents/versions | List visible versions | 200 |
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
| Method | Path | Purpose | Success |
|---|---|---|---|
| GET | /agents/instances/available | Discover accessible agents | 200 |
| POST | /agents/instances | Create an instance | 201 |
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.
| Field | Type | Notes |
|---|---|---|
agent_version_id | UUID | Optional version to use |
display_name | string | Optional, up to 200 characters |
memory_mode | string | twin_linked or ephemeral; defaults to twin_linked |
avatar_url | string | Optional, up to 2,000 characters |
custom_system_prompt_vars | object | Optional variables for the version's system prompt |
is_active | boolean | Optional; defaults to true |
is_public | boolean | Optional; defaults to false |
scope | string | workspace or account; account scope requires an account owner or admin |
max_turns_per_run | integer | Optional, 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.
| Field | Required | Description |
|---|---|---|
key | Yes | Up to 200 characters; letters, digits, _, :, ., and - |
display_name | Yes | Display label, up to 200 characters |
description | No | Up to 2,000 characters |
tool_schema | No | Tool execution configuration object |
is_active | No | Whether 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.