Hanzo
OpenapiAgents

Defines an agent in the caller's org: a model, a system prompt (instructions)…

Defines an agent in the caller's org: a model, a system prompt (instructions) and a set of tool names.

POST /v1/agents

Addresshttps://api.hanzo.ai/v1/agents
MethodPOST
Operationpost_agents
AuthAuthorization: Bearer $HANZO_API_KEY

Defines an agent in the caller's org: a model, a system prompt (instructions) and a set of tool names. The name must be unique in the org and match ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$. An omitted model takes the deployment's configured default; a named one is checked against the gateway's served catalog, so a model this deployment never serves is refused here rather than failing at run time. A long-running agent must carry a 5-field cron schedule (the scheduler would otherwise never fire it) and counts against a per-org cap on scheduled agents.

Request

9 fields, body application/json (required).

FieldInTypeRequiredDescription
computeRefbodystringComputeRef optionally binds this bot to a visor machine.
descriptionbodystringDescription is the one line published as the description of the agent_<name> tool, which is how another agent decides whether to call this one.
executionModebodystringExecutionMode is one-shot or long-running. Empty takes one-shot, which runs only when something POSTs to it.
instructionsbodystringInstructions is the system prompt, up to 32 KiB, stored verbatim.
modelbodystringModel names the model to run on. Omit it to take the deployment's configured default; name one and it is checked against the gateway's served catalogue here,…
namebodystringName is the agent's org-unique handle and the only required field.
schedulebodystringSchedule is the 5-field cron a long-running agent fires on, parsed here so a bad expression is a 400 and not an agent that silently never runs.
serviceAccountIdbodystringServiceAccountID optionally names the IAM agent service account (<org>-<agent>) a scheduled run should be billed AS, so an autonomous run is attributable to a…
toolsbodystring[]Tools are the tool names this agent may call. Omitted or empty grants NONE — that default is the agent's authority and is not widened anywhere.

Response

StatusBodyMeaning
201agentViewcreated

201 body — 13 fields.

FieldInTypeAlwaysDescription
computeRefbodystringComputeRef is the visor machine this bot is bound to, opaque here: this package stores and echoes it, and the binding's lifecycle belongs elsewhere.
createdAtbodystringCreatedAt is when the agent was defined, RFC 3339 in UTC to the second.
descriptionbodystringDescription is the one line another agent reads when deciding whether to call this one: the tool catalogue publishes it as the description of agent_&lt;name&gt;,…
executionModebodystringExecutionMode is one-shot or long-running, and it decides who may start this agent.
idbodystringID is the agent's stable handle, minted here as "agent_" + 32 hex characters of crypto/rand.
modelbodystringModel is the Zen model this agent runs on, and it is always OUR name for it: writes normalize through cloud.ZenModel and the read normalizes again, so an…
namebodystringName is the agent's org-unique handle, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$.
runsbodyintegerRuns is how many executions the org has recorded against this agent, counted at read time.
schedulebodystringSchedule is the 5-field cron the scheduler fires a long-running agent on, evaluated once a minute.
serviceAccountIdbodystringServiceAccountID is the IAM agent service account (<org>-<agent>) a scheduled run is billed AS.
statusbodystringStatus is the agent's readiness, and today it is "ready" on every row: an agent is a definition rather than a provisioned thing, so nothing transitions it.
toolsbodystring[]Tools are the tool names this agent may call, and the list IS the authority: an agent that declares none gets none.
updatedAtbodystringUpdatedAt is the last time any field above was written, same format.

Failure carries the platform error shape — see Errors.

Examples

hanzo agents create

Agents API · All Hanzo APIs · Interactive reference

How is this guide?

On this page