Skip to main content
POST
Run Gateway Turn (Stream)
Run a turn through the gateway and stream every TaskUpdateEvent over Server-Sent Events. This is the fast-time-to-first-token path: a connected event flushes immediately, then the router starts answering before any heavy downstream work begins. Pass id = your conversation_id to start or continue a conversation; omit it to start a new one. Sub-execution events (the downstream agents the router dispatches) are forwarded onto the same stream. Use the sub_tasks query parameter to force how the router dispatches downstream work: sync runs every sub-execution in the foreground (the turn waits for each child, like the email trigger), async pushes every sub-execution to the background (results are pushed back to the conversation later), and auto restores the computed per-task decision. This is separate from whether this API call blocks, and the mode sticks to the conversation until changed. See the Agent Gateway overview for the event model and how sub-executions stream back.

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Query Parameters

version
string | null

Agent version to run.

sub_tasks
enum<string> | null

Force how the gateway dispatches downstream sub-tasks inside this run (not whether this API call blocks): 'sync' runs every sub-task inline, 'async' queues every sub-task, 'auto' restores the computed per-sub-task decision. The mode sticks to the conversation until changed.

Available options:
sync,
async,
auto

Body

application/json
input
AgentExecutionInput · object
required
id
string | null
payload_extension
Payload Extension · object | null
parent_execution_id
string | null
worker_id
string | null
source
string | null
output_format
enum<string> | null
Available options:
text,
markdown,
json,
voice
output_schema
Output Schema · object | null
run_locally
boolean | null
default:false
additional_context
string | null
instructions_override
string | null
test_run_node_id
string | null
expected_output
string | null
events_streaming
boolean | null
default:false
mcp_servers
Mcp Servers · object[] | null
triggering_agent_id
string | null
title
string | null
think_mode
enum<string> | null
default:default
Available options:
default,
harder
disable_attachment_injection
boolean | null
default:false
user_tokens
User Tokens · object | null
user_oidc_token
string | null
return_metrics
boolean | null
default:false
llm_model_provider
string | null

Per-execution override for the LLM provider (e.g. 'openai', 'anthropic'). Falls back to the agent's configured provider when unset.

llm_model_name
string | null

Per-execution override for the LLM model name. Falls back to the agent's configured model when unset.

llm_reasoning_effort
enum<string> | null

Per-execution override for reasoning effort on reasoning-capable models.

Available options:
low,
medium,
high,
xhigh
source_node_type
enum<string> | null

Surface that created this execution (mirrored to AgentExecutionHistory.source_node_type). Falls back to SourceNodeType.SDK at persist time when unset.

Available options:
workbench,
sdk,
task,
assistant,
webhook,
mcp,
a2a,
telegram,
slack

Response

Successful Response