Stream messages (Server-Sent Events)
Server-Sent Events (text/event-stream) feed of new messages for a conversation. Authenticate with a ticket obtained from POST …/stream-ticket (no API key header here, since EventSource cannot set headers). Supports reconnect/catch-up via the Last-Event-ID header (automatically sent by EventSource) or the ?after= query parameter. Emits message events (and periodic heartbeat events to keep the connection alive). Each message event’s SSE id: is the chat id and its data: JSON matches StreamMessageEvent.
Headers
Last received message id; replays anything missed since (sent automatically by EventSource on reconnect).
Query Parameters
Single-use SSE ticket from the stream-ticket endpoint.
Replay messages created after this chat id or ISO-8601 timestamp.
Response
Open Server-Sent Events stream. Emits message events for new chat messages and periodic heartbeat events (~every 20s). Each message frame includes an id: (chat id) for reconnect via Last-Event-ID.
W3C Server-Sent Events frames (event + data lines, blank line terminator).