Cancel Agent Run
Request cancellation. Idempotent: a queued run cancels immediately; a
running run flips to canceling and settles at its next checkpoint; a
terminal run is unchanged.
This endpoint is in beta: it is available to workspaces granted
durable_runs_access, and every other workspace receives
402 durable_runs_not_in_plan.
Authentication
Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.
Path parameters
Agent id (prefixed external id, agent_...).
Run id (prefixed external id, arun_...).
Headers
Response headers
Response
Run id (prefixed external id, arun_...).
The files this run’s own tool calls produced, in the order they were
made: a picture from generate_image or edit_image, a chart from
render_chart, a file run_code kept, a tool response that was not
text. Each is the same object GET /v1/files/{file_id} returns, so
content_path streams the bytes and source.step is the journal
step of the tool call that made it, with no second lookup.
Always present. It grows while the run is going - the event stream
carries each file on the step that produced it - and an empty list on
a finished run means it produced nothing, never that the files are on
another page. A run that failed or was cancelled after making a file
still lists it. A file scoped to the run’s user_identity is listed
here and is readable by a run acting for that same person, exactly as
under /v1/files. A file deleted or expired since is no longer listed.
Lifecycle: queued -> running -> succeeded | failed | canceled | expired. requires_action (a pending human approval) and canceling are transient. Terminal set: succeeded, failed, canceled, expired.
The project this run belongs to; null when it belongs to none. Captured when the run was created, so it does not move if the agent later does.
The run’s result, present only when status is succeeded.
Present only when status is failed.
Why a non-failed run stopped short: max_turns_exhausted, budget_exhausted, or output_schema_violation (the agent never produced an object matching input.output_schema; output.reply keeps its prose and output.data is absent).
What the run spent, present only once it has settled: wall-clock, the tokens summed across every step, the same tokens split per model, and what they cost at your plan’s rates. Written once at settle and never restated; the webhook payload carries the same values. input_tokens includes the cached reads and cached_input_tokens is that subset, so the two are never added. cost_micro_usd is an integer in millionths of a US dollar, computed from the rate card version named alongside it, and is informational: your invoice is authoritative. A delegated child run reports its own usage; the parent never sums it.
A human approval a run is durably parked on (present on AgentRun only while status is requires_action). Rendered VERBATIM for the approver - never a summary the agent wrote - so an injected agent cannot misrepresent what it is about to do. Resolve it with submitRun.
The run that delegated this one a sub-goal, absent on a root run. It is the upward half of lineage - what makes a child run of a member agent attributable to the team run that caused it (listRunChildren is the downward half).
When a worker picked the run up. Absent while queued; the gap between this and created_at is queue wait, not agent time.
When the run settled. Present for every terminal status - succeeded, failed, canceled and expired alike - and absent otherwise.