The agent object
The harness — the agent loop.
GET /v1/harnesses publishes the set, what each one can be admitted for, and whether it holds a sandbox between turns.Model identifier, e.g.
z-ai/glm-5.3-flash. See the model router.Optional per-turn model choice:
{ "options": { "<model id>": "<what it is for>", … }, "min_confidence"?: number }. When set, every turn of every session picks one of the options over the transcript so far and model is the default; null (the default) pins model. See model auto-selection.Default completion window:
immediate | priority | loose.The toolset configuration. See Tools.
Attached skill references. Each entry is a slug or id, optionally suffixed
@version to pin an immutable version (e.g. refund-policy@3). An unpinned reference resolves to the skill’s latest version at session start.The team this agent coordinates: a
{ "type": "coordinator", "agents": [ … ], "board"?: boolean } object, or false/null when it coordinates none. See Coordinator.Who the agent may send work to with
send_to_agent: true (any agent in the organization but itself — the default, and what every agent created before this field reads as), false (nobody; the agent is offered neither send_to_agent nor list_agents), "team" (the agents on its multiagent roster), or a list of agent names. See Tools.Email preferences:
{ email, approvals, questions, updates }. Each toggle is independent. updates fires when a run finishes a turn; approval and question messages deep-link to the paused session. On a team, a member’s approvals and questions are mailed from its coordinator’s settings and link the coordinator’s session, where they are answered; a member’s own session sends nothing. All fields default off.Optional JSON Schema the agent’s final result must satisfy. Sessions inherit it as their default and may override it per run. See Structured outputs.
Whether a run that cannot produce an object conforming to
output_schema is a failure rather than a plain-text answer. Sessions inherit it and may override it per run.Monotonic version counter. Pass this as
expected_version on update for optimistic concurrency.Create an agent
POST /v1/agents → 201 Created.
Model identifier: any id the model list publishes, or
vetta/auto. Anything else is validation_failed naming model, on create and on an update that changes it.Per-turn model choice among two to sixteen concrete catalogue ids, each priced for
window; model must be one of them. Defaults to null. Refused with feature_not_configured (501) on a deployment without an evaluation model, so a saved policy is always one every turn can act on.Spend controls (
cap_micro_usd, max_task_micro_usd, period). Agents cannot be created without a budget. max_task_micro_usd may not exceed cap_micro_usd, and a cap of 0 stands only beside a ceiling of 0 (an agent that spends nothing); either is validation_failed naming the field.Defaults to
"pi". A harness the deploy cannot run is refused when the session starts, naming the field — see harnesses.Skills to attach. Each entry is a slug/id, optionally
@version to pin (e.g. refund-policy@3).Declare a team:
{ "type": "coordinator", "agents": [ … ], "board"?: boolean } with 1 to 20 roster entries. false or null declares none; on a PATCH, null clears a roster. Defaults to false. See Coordinator.Who the agent may send work to:
true (anyone in the organization), false (nobody), "team" (its multiagent roster — refused with validation_failed when the agent has none), or up to 50 agent names. Defaults to true.Optional
{ email, approvals, questions, updates } settings. An email address is required when any toggle is enabled.JSON Schema the final result must satisfy. Defaults to
null. See Structured outputs.Treat a non-conforming result as a failure rather than answering in prose. Defaults to
false; needs an output_schema.Retrieve an agent
GET /v1/agents/{id} → 200 OK with the current configuration, including current_version.
List agents
GET /v1/agents → 200 OK, cursor-paginated. See Pagination.
Response
Update an agent
PATCH /v1/agents/{id} → 200 OK. Applies a partial update and creates a new immutable version. A no-op update creates no new version.
Updates use optimistic concurrency: pass the expected_version you read. If it no longer matches current_version, the API returns 409 with code version_conflict and applies nothing. Omitting expected_version performs an unconditional, last-write-wins apply — use this for declarative CI that reconciles an .agent.yaml toward a desired state.
Any subset of the mutable fields (
name, system, model, model_selection, window, tools, mcp_servers, skills, multiagent, handoffs, budget, notifications, output_schema, structured_output_required, description, metadata). Renaming is deliberately not a config change: a patch that only sets name mints no new version.Response
Version conflict (409)
If another writer advanced the version, you get:409 Conflict
current_version, and retry.
The agent-version object
Each update snapshots the full config into an immutable agent version. Versions never change once written.Handoff policy at this version. Versions minted before the field carry
true.List versions
GET /v1/agents/{id}/versions → 200 OK. The full immutable version history in one page: this list is not paginated — limit and after are ignored, and the reply always carries has_more: false, next_cursor: null. Each row is a whole agent-version object; versions are addressed by their version number, not by an id.
Response
Retrieve a version
GET /v1/agents/{id}/versions/{n} → 200 OK with the full agent-version object for version n. Use it to inspect or diff a past configuration.
Response
Roll back to a version
POST /v1/agents/{id}/rollback → 200 OK. Creates a new version whose config equals an earlier one — history is never rewritten. Returns the full agent object at that new version.
The
current_version you last read, for optimistic concurrency. Omit for an unconditional rollback.Response
Spend
GET /v1/agents/{id}/spend → 200 OK. Metered spend for the current budget period, in micro-USD, optionally broken down by component with ?by=component.
The agent’s computer time is billed to the agent, once per running interval however many sessions shared the machine, and to no session. So the agent’s spend is more than its sessions’ consumed_micro_usd added up; the computer component is the difference.
Response
Delete an agent
DELETE /v1/agents/{id} → 200 OK. Removes the agent. Version history is retained for existing sessions. Its open board cards are left unassigned. If the agent is on another agent’s team roster, it is removed from that roster: each coordinator gets a new version without it (a roster left with no members is cleared to null), and the response lists those coordinators in removed_from, each at the version that dropped it. An agent on no roster answers removed_from: []. Each roster change is also recorded in the audit log as agent.updated.
Response
Run an agent
Create a session to run an agent directly.