Create an agent
id, object, current_version, and created_at. current_version starts at 1 and increments each time an update changes the agent.
Define an agent as a file
An agent is a declarative configuration, so the recommended way to manage it is a checked-in.agent.yaml file. The whole config — model, harness, prompt, tools, budget — lives in one file you can review, diff, and version-control alongside your code. The CLI reads it on create, update, and apply.
refunder.agent.yaml
apply is the GitOps path. It upserts by name and omits version, so the checked-in file is the source of truth (last write wins) — exactly what a CI apply loop wants. For interactive edits where you don’t want to clobber a concurrent change, use update with --expected-version (a mismatch is a 409). See versioning below.Agent, session, run
An agent is a durable definition; work happens in sessions that reference it. One agent backs many sessions and cron deployments, each independently budgeted, streamed, and controlled.Versioning
Every change to an agent’s configuration produces a new immutable version. A version is a frozen snapshot of the whole config — model, system prompt, tools, skills, window, budget, and metadata — identified by an integer that increments from 1. Nothing about a past version ever mutates, which is what lets a long-running session or a scheduled deployment keep behaving exactly as it did the day it started.- Optimistic concurrency. Supply
expected_versionto apply the update only if nothing else changed it in the meantime; a mismatch returns409withcode: "version_conflict". Omit it to apply unconditionally (last write wins) — the path a declarativeapplyloop uses. - Omitted fields are preserved. Send only what you want to change.
- Array fields (
skills,mcp_servers) are fully replaced by the new array. - No-op detection. If an update produces no change, no new version is created.
- Sessions and deployments pin a version. A running session keeps the config it started with; a deployment can pin a specific
agent_versionfor staged rollout. New versions apply only to new work.
Lifecycle
Configuration reference
string
required
A human-readable name for the agent, 1–100 characters.
string
required
The model that powers the agent: a model ID string such as
z-ai/glm-5.3-flash, or vetta/auto. An id the catalogue does not serve is refused when the agent is saved. See Model router & inference.string
default:"pi"
The harness — the agent loop that drives each turn. It defaults to
pi; GET /v1/harnesses publishes the set you can choose from. The runtime beneath it (durability, tools, budget, policy) is the same whichever harness you pick.object
required
Spend limits, in integer micro-USD on the wire. An agent cannot be created without one. See Budgets.
string
A system prompt that defines the agent’s behavior and persona. Distinct from the user messages that describe the work.
string
default:"immediate"
Default completion window:
immediate, priority, or loose. Overridable per session.object
The tools available to the agent, as a single toolset object: a
default_config plus per-tool configs, each entry { enabled, permission } where permission is allow, ask, or deny. See Policies. Built-ins are enabled by capability; MCP and connection tools register under the same keys.object[]
MCP servers the agent can reach, referenced by
mcp_toolset.object
object | boolean | null, default false. A coordinator declaration, { "type": "coordinator", "agents": [...], "board"?: boolean }, listing the agents this agent can delegate to. false or null means no roster; a PATCH of null clears one. See Rosters and versioning.boolean | "team" | string[]
Who the agent may send work to with
send_to_agent: true (any agent in the organization — the default), false (nobody; it is offered neither send_to_agent nor list_agents), "team" (only its multiagent roster), or a list of agent names.object
A default JSON Schema for a structured result. When set, a session goes idle carrying a typed
structured_output; a session can override it per run.string
A description of what the agent does.
object
Arbitrary key-value pairs for your own tracking.
computer or identities) is refused with validation_failed. Grant a persona with naive identity attach or POST /v1/agents/{id}/identities, and create a computer with naive computer create.
Next: runtime & durability
How the harness drives each turn, and how the runtime makes it durable.