POST /responses — stateless
No conversation is named and none comes back. Internally a conversation is opened
on the api channel because a turn needs somewhere to live, and no messages
are written to it — so the request leaves a record that it happened and what it
cost, and no copy of what was said.
POST /agents/{id}/runs — a payload and a task
For work that is not a conversation: an object to reason over plus a line saying
what to do with it.
GET /agents/{id}/runs/{run_id}, which needs agents:read.
Reading a run is a different authority from starting one.
The input
channeldecides both rendering and which ledger line the turn bills to.""means “not stated” and falls through to the conversation’s own channel — it is not a synonym forapi. Values:api,web,website,whatsapp,phone,voice.attachmentscarry arefto something already stored. Never bytes.request_contextis caller-supplied context. The one key the runtime acts on isresource_id, which narrows the execution context to that resource — and raises rather than narrowing to nothing when the caller could not reach it. That refusal isinvalid_context, a 403.
The options
Send them flat in the body or nested underoptions; both are read and the
nested value wins. An unrecognised key inside options is a 400.
The three policy fields can only ever subtract. There is no value meaning
“retrieve more than this agent is configured for”, or “use a tool this agent
does not have”.
timeout_ms out of range is refused, not clamped. A caller who asked for ten
minutes and silently got sixty seconds reads the resulting timeout as a platform
fault.
What you may not set
These are refused with a 400 that names the field and gives the reason, because each is one a caller reasonably expects to work and the answer is a decision rather than an omission.The response
status is one of six: queued, running, completed, failed, cancelled,
blocked. Four of those are terminal — completed, failed, cancelled,
blocked. Anything else is still in flight and a caller polling it may see it
change.
id is the public run id (run_…) and is the same id the stored run carries, so
a caller quoting it in a ticket lands on one row. Database primary keys are never
exposed.
Cancelling
responses:create. Any run you may read can be cancelled here, not
only ones from POST /responses — the ids are one namespace.
Two success statuses, and the difference is information rather than success:
- 202 — the run was in flight and will stop at its next checkpoint.
- 200 — there was nothing left to stop.
Preview and drafts
"preview": true runs the agent’s unpublished configuration. Asking is free;
being allowed is not.
agent:preview scope, which is issued on its own and is
implied by nothing — a key that may edit an assistant does not thereby preview
its drafts.
Statuses a preview run may execute: active, draft, paused, preview.
Without preview, only active — asking for anything else is
agent_not_available, a 409.
