AgentSchema. API detail: Agents.
create
POST /v1/agents. AgentCreate requires name (1–100 characters), model (an id client.models.list() publishes, or vetta/auto) and budget (max_task_micro_usd at most cap_micro_usd); everything else on the agent config (system, window, harness, …) is optional. harness selects the agent loop and defaults to pi; client.harnesses.list() publishes the set you can choose from.
list
GET /v1/agents, cursor-paginated. See Pagination.
get
GET /v1/agents/{id}.
update
PATCH /v1/agents/{id}. Every config field is optional; a successful patch mints a new version rather than editing the current one. Pass expected_version for optimistic concurrency — a mismatch is a 409 conflict.
listVersions
GET /v1/agents/{id}/versions. History is immutable and never rewritten.
getVersion
GET /v1/agents/{id}/versions/{version}.
rollback
POST /v1/agents/{id}/rollback. Mints a new version cloning to_version — a rollback is itself a versioned change, so history stays linear and auditable.
spend
GET /v1/agents/{id}/spend — metered spend for the agent’s current budget period, integer micro-USD:
by: "component" adds a by_component breakdown — model (the five token tiers summed), computer, search, media, and other for anything a debit did not itemise. A component with no spend is absent, and the breakdown always sums to spent_micro_usd. Absent unless asked for.
Computer time is billed to the agent and to no session, so spent_micro_usd is more than the agent’s sessions’ consumed_micro_usd added up; computer is the difference.
computer
GET /v1/agents/{id}/computer. The agent’s one computer, which every session of the agent works on, or null before any session has needed one. The machine under it can change while its files are kept, so read this rather than caching a cmp_ id. See An agent’s computer.
delete
DELETE /v1/agents/{id}. Answers the standard { id, object, deleted: true } acknowledgement, plus removed_from: every coordinator whose team roster named this agent and now has a new version without it. Empty when the agent was on no roster.