Stream agent turns as an AI SDK UI message event stream.
text/event-stream produced by the AI SDK’s toUIMessageStreamResponse(). Use this for real-time chat UIs that want text deltas, tool-call starts/results, step boundaries, and step-finish usage telemetry as they happen.
The conversation id is echoed in the x-conversation-id response header.
approvalResponse: { toolCallId, approved }. The caller’s messages should include the pending tool call so the server can resume with the frozen args or the rejection result.Body shape — AI SDK UI messages. messages is the standard AI SDK UI message array (not plain chat messages). On first turn, send the user’s message as a UI message; on subsequent turns, send the full accumulated history.Runtime. Node runtime (runtime = "nodejs"). Streams terminate early on client disconnect via abortSignal.Related: Start an agent chat run (async poll), Run an agent chat synchronously (blocking).Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
AI SDK UI messages array. Typically the full conversation so far, with the new user turn appended.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Optional hint about which page the user is on, passed to the system prompt for context.
Sent when resuming after a tool-approval gate. The server executes the frozen tool call (or rejects it) and splices the result back into the stream.
SSE stream. Events follow the AI SDK UI message format — text deltas, tool-call starts/results, step boundaries, step-finish with usage, stream-finish. Header x-conversation-id carries the conversation the run is writing to.