The native HTTP endpoints for starting, cancelling, reattaching to, and reading runs.
A run is one execution of the graph within a session. These endpoints list and read runs, start runs either attached to the original streaming request or detached in the background, cancel visible runs, and open live Server-Sent Events streams to active runs.
POST /v1/runs starts an attached run and streams events on the same response. If that response is
dropped before the run finishes, the run is cancelled. POST /v1/runs/start starts a detached run and
returns its IDs immediately; the run continues after the response is sent. Use
GET /v1/runs/{run_id}/events to observe live events from a running run, and
PUT /v1/runs/{run_id}/cancel to explicitly cancel a visible run.
Find runs for a session with optional filtering and pagination.
/v1/sessions/{session_id}/runsFind runs for a session with optional filtering and pagination.
The session ID.
Maximum page size.
Opaque cursor for the next page.
Run IDs to filter on.
Session IDs to filter on.
Run statuses to filter on.
Filter by creation time.
Filter by creation time.
Filter by update time.
Filter by update time.
Get a run by ID.
/v1/runs/{run_id}Get a run by ID.
The run ID.
Create a new attached run and stream its events back as Server-Sent Events (SSE).
/v1/runsCreate a new attached run and stream its events back as Server-Sent Events (SSE).
Optional session ID. If omitted, one is generated automatically.
Optional run ID. If omitted, one is generated automatically.
Optional checkpoint to start the run from. If omitted, the run continues from the session's latest state.
Opaque resume data supplied by the graph.
Optional model selection, inference, timeout, and retry configuration for this run.
Optional capability override for this run.
Messages that seed the run. At least one message is required.
Client-supplied context variables.
Initial context object.
Client-defined tools available to the run.
curl -X POST http://localhost:8080/v1/runs \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme" \
-d '{
"session_id": "8f3e19d8-3bc0-4fd5-bb02-7ac89af9d7bc",
"model": {
"override": {
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"inference_params": {
"max_tokens": 4096
}
},
"timeout": 30000,
"retry": {
"max_attempts": 3,
"initial_backoff": 250,
"max_backoff": 5000
}
},
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "value": "What is 42 plus 7?" }
]
}
]
}'The stream keeps the connection alive with periodic keep-alive comments between events. Closing the
connection before the run finishes cancels the attached run. A full run looks like this on the wire:
event: run_started
data: {"kind":"run_started","timestamp":1710000000.0,"session_id":"...","run_id":"..."}
event: messages_snapshot
data: {"kind":"messages_snapshot","timestamp":1710000000.1,"messages":[...]}
event: text_message_start
data: {"kind":"text_message_start","timestamp":1710000000.2,"message_id":"..."}
event: text_message_content
data: {"kind":"text_message_content","timestamp":1710000000.3,"message_id":"...","delta":"Hello"}
event: text_message_end
data: {"kind":"text_message_end","timestamp":1710000000.4,"message_id":"..."}
event: run_finished
data: {"kind":"run_finished","timestamp":1710000000.5,"session_id":"...","run_id":"...","status":"completed","interrupt_payload":null,"result":null}Start a new run and return immediately with its IDs instead of keeping a streaming response open.
/v1/runs/startStart a detached run and return its run and session IDs.
The request body accepts the same fields as POST /v1/runs. The run continues on the server after the
HTTP response is returned. Dropping this request's connection after the response has been sent does
not cancel the run.
Optional session ID. If omitted, one is generated automatically.
Optional run ID. If omitted, one is generated automatically.
Optional checkpoint to start the run from. If omitted, the run continues from the session's latest state.
Opaque resume data supplied by the graph.
Optional model selection, inference, timeout, and retry configuration for this run.
Optional capability override for this run.
Messages that seed the run. At least one message is required.
Client-supplied context variables.
Initial context object.
Client-defined tools available to the run.
curl -X POST http://localhost:8080/v1/runs/start \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme" \
-d '{
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "value": "What is 42 plus 7?" }
]
}
]
}'The response body contains the IDs to use for later lookup, cancellation, or live reattachment:
{
"run_id": "f7b97459-06a7-4e01-bb91-b8072d40452f",
"session_id": "8f3e19d8-3bc0-4fd5-bb02-7ac89af9d7bc"
}Cancel a visible run by ID.
/v1/runs/{run_id}/cancelCancel a run by ID.
Cancellation is idempotent for a run that exists in the caller's tenant. The endpoint returns
204 No Content whether the call transitions a running run to cancelled or the run was already in a
terminal state. A run that does not exist and a run that belongs to another tenant both return 404.
The run ID.
curl -X PUT -o /dev/null -w "%{http_code}\n" \
http://localhost:8080/v1/runs/f7b97459-06a7-4e01-bb91-b8072d40452f/cancel \
-H "X-Tenant-ID: acme"Open a live Server-Sent Events stream to a run that is currently running.
/v1/runs/{run_id}/eventsStream live events for a running run from this point forward.
Reattachment is live-only. The stream receives events produced after the request attaches; it does not
replay events that were produced earlier. Dropping this stream closes only this observer and does not
cancel the run. Use PUT /v1/runs/{run_id}/cancel when the client wants to stop the run.
The run ID.
curl -N http://localhost:8080/v1/runs/f7b97459-06a7-4e01-bb91-b8072d40452f/events \
-H "X-Tenant-ID: acme"Only runs with status running can be reattached to. A visible run that has already completed,
failed, interrupted, or been cancelled returns 409. A missing run, or a run owned by another tenant,
returns 404.
Reattach uses pub/sub to deliver live run events to GET /v1/runs/{run_id}/events streams. By
default, generated standalone agents use an in-memory transport with no external service:
export AGENT__PUBSUB__KIND=memory
export AGENT__PUBSUB__CAPACITY=4096The in-memory transport is process-local. If a deployment has multiple replicas and a reattach request may land on a different process than the one executing the run, configure the Redis-compatible transport:
export AGENT__PUBSUB__KIND=redis
export AGENT__PUBSUB__URL=redis://localhost:6379Dragonfly can provide that Redis-compatible pub/sub service:
services:
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly
ulimits:
memlock: -1
ports:
- 6379:6379Pub/sub carries live events only. It does not store run history or replay missed events. Cancelling a run is persisted through the shared database and does not depend on pub/sub.
A single client-supplied context variable made available to a run.
What the variable represents.
The variable value.
A client-defined tool made available to a run.
The tool name.
What the tool does.
A JSON Schema object describing the tool's parameters.
Inference parameters for a model request. Every field is optional; omitted fields use the provider or model defaults.
Maximum number of tokens to generate.
Sampling temperature.
Nucleus sampling probability mass.
Top-k sampling cutoff.
Sequences that stop generation when produced.
Penalty applied in proportion to how often a token has appeared.
Penalty applied to tokens that have already appeared at all.
Seed for deterministic sampling.
Provider-specific parameters passed through unchanged.
Per-run model call configuration. Timeout and retry values supplied here take precedence over
manifest and startup defaults independently. Omitted values continue to use the corresponding
startup defaults. The override object controls model selection and inference parameters only for
this run.
Optional provider, model, and inference parameter overrides.
Maximum time in milliseconds to establish the model response stream. This does not limit the duration of an established stream.
Retry policy for transient failures while establishing the model response stream.
AG-UI clients can supply the same object through forwarded_props.model. It is interpreted by the
ReAct adapter and does not add fields to the AG-UI protocol itself.
Per-run overrides for the agent's configured model. Any omitted field falls back to the manifest configuration.
Provider name to use instead of the configured one.
Model identifier to use instead of the configured one.
Inference parameter overrides.
Retry policy for transient failures before the model response stream is established. A response stream that has already started is not retried.
Maximum number of attempts, including the first request.
Delay in milliseconds before the first retry.
Maximum base backoff between attempts, in milliseconds. Jitter may add a small delay after the base backoff is capped.
Per-run override for the agent's capability set. The strategy field selects how the supplied
capabilities combine with the agent's configured capabilities.
Use the agent's configured capabilities unchanged.
inheritAdd the listed capabilities to the configured set.
extendCapabilities to add.
Use only the listed capabilities.
replaceCapabilities to use.
A single RFC 6902 JSON Patch operation, discriminated by op. State deltas and tool activity updates
are expressed as arrays of these operations.
Adds a value at the target location.
addJSON Pointer to the target location.
The value to add.
Removes the value at the target location.
removeJSON Pointer to the target location.
Replaces the value at the target location.
replaceJSON Pointer to the target location.
The replacement value.
Moves a value from one location to another.
moveJSON Pointer to the source location.
JSON Pointer to the target location.
Copies a value from one location to another.
copyJSON Pointer to the source location.
JSON Pointer to the target location.
Asserts that the target location holds the given value.
testJSON Pointer to the target location.
The value to compare against.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0Search the agentc documentation