Skip to main content
Send a message and stream the run as Server-Sent Events.
Same endpoint and same params as SendMessage — only the method name changes. The response is text/event-stream instead of a JSON body.

Request

Response stream

Each SSE frame carries one complete JSON-RPC response envelope in its data: line. Frames have no event: name — read data: and parse it.
Every frame’s id echoes your request id.

The four event shapes

result is a field-presence union with exactly one key.
Streamed content arrives as artifactUpdate, not as tokens. There is no token event and no complete event. Accumulate artifactUpdate frames whose append is true, and treat lastChunk: true as the end of that artifact.
Errors mid-stream arrive as an ordinary frame carrying a JSON-RPC error instead of a result.

Reading the stream

Terminal states

The stream ends when the task reaches a terminal state. Task states are TASK_STATE_* strings — see Tasks for the full set and which four are terminal. TASK_STATE_INPUT_REQUIRED is not terminal. It means the run is parked waiting on a human — most often an approval gate. Resume with a follow-up SendMessage; see A2A overview.

Reconnecting

If the connection drops mid-run, use SubscribeToTask rather than resending the message. It replays the current snapshot and then tails live updates.