Skip to main content

Execute Agent (Streaming)

Execute a research agent using Server-Sent Events (SSE) to receive responses in real time. As the agent generates text, delta events are streamed to the client.
Ideal for long-running research tasks and UI applications that display responses in real time. For simple fire-and-forget use cases, see Execute Agent (Non-Streaming).

New Execution

Headers

Request Body

Parameters

Mention Object

Resume (Restart Existing Run)

Resume execution after a HITL (Human-in-the-Loop) pause, such as plan or report confirmation.

Request Body

Parameters

SSE Event Format

Each event is sent as data: {JSON}\n\n.

config event

Sent once at the start of the stream.

delta event

Sent each time the agent generates text.

step event

Sent when an execution step completes.

browse events

When the browse tool is selected, browser automation progress is streamed as events.
When you receive browse-ask-human, answer through /browser/answer-question using browse-start.payload.websocketInfo.session_id as sessionId. Unlike plan/report/matrix reviews, you do not call /agent/run/stream/{runId} after answering a browser question.

complete event

Sent when the agent finishes. This is the final event in the stream.

error event

Sent when an error occurs.

Additional internal events

The SSE stream emits every internal event as the agent progresses. In addition to the basic events above (config / delta / step / browse-* / complete / error), the following are also streamed:
Recovering a dropped stream: every event sent over SSE is also persisted as agentRun.process in the database. If your SSE connection drops, call GET /turn/listturns[].agentRun.process returns the same event timeline, and referenced sources are available in turns[].agentRun.publicSourceAgentRuns / privateSourceAgentRuns.

Examples

Resume Example

Error Responses

If an error occurs before the stream starts, a regular JSON response is returned instead of SSE.