Skip to main content
POST
Create an agent

Headers

idempotency-key
string

Optional Idempotency-Key header for safe retries

Required string length: 1 - 128
Pattern: ^\S[\s\S]*\S$|^\S$|^$

Body

application/json
name
string
required

Human-readable agent name

Required string length: 1 - 256
model
required

Model ID string or an object with an ID and optional provider credential

Minimum string length: 1
harness
enum<string>

Agent harness. Defaults to pi.

Available options:
pi,
deepseek,
opencode,
custom,
codex,
claude-code,
antigravity,
grok-build
system
string | null

System prompt text

Maximum string length: 100000
description
string | null

Agent description

Maximum string length: 2048
metadata
object

Up to 16 string key/value pairs

mcp_servers
object[]

MCP servers whose tools the agent may use. Each tool is offered as mcp____.

Maximum array length: 20
tools
object[]

Permission policies for MCP servers' tools (mcp_toolset), HTTP APIs described by an OpenAPI document (openapi_toolset), and custom tools the caller's application runs (custom).

Maximum array length: 104

Response

Success

id
string
required
Minimum string length: 1
type
enum<string>
required
Available options:
agent
version
integer
required
Required range: 1 <= x <= 9007199254740991
name
string
required
Required string length: 1 - 256
harness
string
required
Minimum string length: 1
model
object
required
system
string | null
required
Maximum string length: 100000
description
string | null
required
Maximum string length: 2048
mcp_servers
object[]
required
Maximum array length: 20
tools
object[]
required
Maximum array length: 104
created_at
string
required
updated_at
string
required
archived_at
string | null
required
metadata
object