Skip to main content
POST
POST /v1/run is the canonical agent run endpoint. Set stream: false for JSON responses. When stream is omitted or true, the endpoint returns Server-Sent Events for sandbox-backed and managed agents. Runs can target in_sandbox, managed, or local-mac agents. in_sandbox runs wake the linked sandbox when possible. local-mac runs either register a thread for the local sidecar caller or dispatch over RunMesh to the bound device.

Request Body

string
required
Agent slug or ID.
string
User prompt. Either prompt or messages is required.
array
Caller-managed conversation history. Use this when you do not want server-managed thread history.
string
Persist the run into a server-managed thread. Reuse the same ID to continue the thread.
boolean
default:"true"
false returns JSON. true returns Server-Sent Events.
object
Per-run overrides: maxTokens, maxTurns, and temperature.
object
Caller metadata stored with the run.

Response

string
Run ID.
string
Run status, such as completed, registered, or dispatched.
string
Final assistant response for non-streaming runs.
string
Thread ID when threading is active.
string
Active rollout ID when the run is registered for a cloud thread.
string
in_sandbox, managed, or local-mac.
object
Token usage when available.

Thread APIs

Thread history and live updates are exposed through /v1/threads, not the run endpoint:
Use /v1/threads/{threadId}/events for durable event history and wss://api.runtools.ai/v1/threads/{threadId}/events?api_key=... for live frames.

Legacy Per-Agent Endpoint

POST /v1/agents/{slug}/run still exists, but new code should prefer POST /v1/run because it has the same request shape used by the SDK and thread helpers.