Skip to main content
POST
Create an agent

Authorizations

Authorization
string
header
required

An aik_… programmatic API key (app.atako.ai → Settings → API keys) or a Supabase session JWT.

Body

application/json
name
string
required
Minimum string length: 1
image
string
required

PNG filename under apps/web/public/aiygents/.

mission
string | null

The agent's mission in 1–3 sentences, trimmed.

Maximum string length: 20000
systemPrompt
string | null

Free-text agent instructions, trimmed. Stored and sent to the orchestrator as-is (no business context appended).

Maximum string length: 20000
clientContext
string | null

Free-text per-agent business context, trimmed. Kept in its own column.

Maximum string length: 20000
modelId
string

Either an ai_models UUID (from GET /models or aiModelId in GET /models/catalog) or a raw OpenRouter slug (slug in GET /models/catalog, e.g. "mistralai/mistral-small"). A slug unknown to the catalog is rejected with 400. Omitted → admin-declared default model. With a direct-provider BYOK key (openai/anthropic), this is instead the provider's own model id.

Example:

"anthropic/claude-sonnet-4"

harnessId
string<uuid>

From GET /harnesses.

teamId
string<uuid> | null

Assigns the agent to a shared team instead of keeping it personal.

modelConfig
object

Per-task-type model overrides, forwarded to the orchestrator webhook.

engine
enum<string>

Defaults to the platform default engine (hermes). opencode additionally requires allowedRepos.

Available options:
openclaw,
hermes,
opencode
allowedRepos
string[]

Repositories (owner/repo) the agent may work on. REQUIRED (≥1) for engine: opencode, which also requires an active company GitHub connection; ignored by the other engines.

llmKeyId
string<uuid>

BYOK: id of a company LLM provider key (see docs — BYOK key management is not part of this customer API cut).

Response

The created agent (raw row).

The raw agents table row, returned verbatim by POST /agents (201) and POST /agents/{id}/end (200, under .session). Every column, including several operational/internal fields not otherwise exposed.

id
string<uuid>
required
clientId
string<uuid>
required
name
string
required
image
string
required
engine
enum<string>
required
Available options:
openclaw,
hermes,
opencode
status
enum<string>
required
Available options:
active,
completed,
paused,
provisioning,
unresponsive,
failed
startDate
string<date-time>
required
createdAt
string<date-time>
required
teamId
string<uuid> | null
companyId
string<uuid> | null
systemPrompt
string | null

Raw user instructions (no business context appended).

mission
string | null
profileUpdatedAt
string<date-time>
modelId
string<uuid> | null
directModelId
string | null
modelConfig
object | null

Per-task-type model overrides.

llmKeyId
string<uuid> | null

Set for a BYOK agent (company LLM provider key); null for the platform key.

harnessId
string<uuid> | null
agentAuthTokenHash
string | null
agentAuthIssuedAt
string<date-time> | null
agentAuthLastUsedAt
string<date-time> | null
activatedAt
string<date-time> | null
endDate
string<date-time> | null
lastHeartbeatAt
string<date-time> | null
lastReadAt
string<date-time> | null
engineVersion
string | null
engineImage
string | null
engineRequestedVersion
string | null
upgradingAt
string<date-time> | null
upgradeRequestedAt
string<date-time> | null
upgradeStatus
enum<string> | null
Available options:
requested,
running,
succeeded,
failed
upgradeError
string | null
provisioningError
string | null
pausedAt
string<date-time> | null
pausedReason
string | null
clientContext
string | null

Per-agent "contexte business" free text.