Skip to main content
POST
/
api
/
captain
/
agents
Create agent
curl --request POST \
  --url http://localhost:63372/api/captain/agents \
  --header 'Content-Type: application/json' \
  --cookie captain_session= \
  --data '
{
  "id": "coder",
  "name": "Code Helper",
  "default": false,
  "workspace": "./agents/coder",
  "provider": "anthropic",
  "model": "claude-sonnet-4-5-20250929",
  "max_iterations": 20
}
'
{
  "ok": true,
  "id": "coder"
}

Authorizations

captain_session
string
cookie
required

HMAC-signed session cookie returned by /api/captain/auth/login. Valid for 7 days. Invalidated when password changes.

Body

application/json
id
string
required
Example:

"coder"

name
string
required
Example:

"Code Helper"

default
boolean
Example:

false

workspace
string
Example:

"./agents/coder"

provider
string
Example:

"anthropic"

model
string
Example:

"claude-sonnet-4-5-20250929"

max_iterations
integer
Example:

20

Response

Agent created

ok
boolean
required
Example:

true

id
string
required
Example:

"coder"