Skip to main content
The streaming endpoint runs an agent and returns the response as a continuous Server-Sent Events (SSE) stream. Instead of waiting for the full response, your client receives typed events — reasoning traces, content tokens, and tool call notifications — as they are produced. This is the recommended integration for any user-facing chat interface. All requests require a valid bearer token in the Authorization header.

Start a streaming run

Accepts the same RunRequest body as the synchronous endpoint and returns a text/event-stream response. Each event is a JSON-encoded AgentStreamEvent object.

Path parameters

string
required
The unique identifier of the agent to run. Retrieve valid IDs from GET /api/agents.

Request body

string
required
The user’s input or query.
string
A UUID identifying an existing conversation session. Enables multi-turn conversations. Omit to start a fresh session.
string
Associates the run with a specific user for memory scoping and audit logs.
string
Tenant identifier for multi-tenant deployments.
boolean
default:"false"
When true, the agent appends suggested follow-up questions to the final STOP event payload.
object[]
Array of multimodal inputs. Each object has a type (MIME type string) and data (base64 or URL).
object
Optional model overrides (model, temperature, maxTokens).

Response: AgentStreamEvent schema

The response is a text/event-stream. Each line prefixed with data: contains a JSON-encoded AgentStreamEvent:
string
required
The event type discriminator. See the EventType reference below.
string
required
The payload for this event. Its meaning depends on the event type — a text delta for CONTENT_DELTA, a JSON string for tool events, or an error message for ERROR.
number
required
Unix epoch milliseconds at the time the event was emitted by the server.

EventType values

Listen for REASONING_DELTA events to show a “thinking…” spinner or expandable reasoning trace before the first CONTENT_DELTA arrives. This significantly improves perceived responsiveness for complex queries.

Raw SSE stream example

TypeScript example


Check run status

Fetches the current status and metadata of a specific run. This endpoint is useful after a streaming run completes to retrieve the full AgentRun entity, including timestamps and final output.
string
required
The agent that owns the run.
string
required
The run identifier, returned in the START event’s data payload.
Returns an AgentRun entity with status (RUNNING, COMPLETED, FAILED, PAUSED, or CANCELLED) and associated timestamps.

Batch status check

Fetch the status of up to 100 runs in a single request. Run IDs that do not exist are simply absent from the response — no 404 is returned for missing IDs.
string
required
The agent that owns the runs.
string
required
A comma-separated list of run IDs to check. Maximum 100 IDs per request.
Example response
The batch status endpoint significantly reduces polling overhead. For 10 concurrent runs polled every 3 seconds, one batched call replaces 10 individual requests — dropping from ~200 requests/minute to ~20.