Join Thread Stream
This endpoint streams output in real-time from a thread. The stream will include the output of each run executed sequentially on the thread and will remain open indefinitely. It is the responsibility of the calling client to close the connection.
Headers
The ID of the last event received. Used to resume streaming from a specific point. Pass '-' to resume from the beginning. A gap event is sent, first on a resume or mid-stream, when events the client should receive may be missing. Its reason is expired when they may have aged out of the stream's history; unknown_id when the ID is later than any event the thread streamed, and the stream starts over from the beginning; or too_large when an event was over the size limit, with that event's stream mode in mode. expired errs on the safe side: once the stream's history has expired, a resume gets it unless its ID is the thread's last streamed event, which is kept for an hour after that.
Query Parameters
Stream modes to control which events are returned. 'lifecycle' returns only run start/end events and interrupts events (the interrupts a run answers), 'run_modes' returns all run events (default behavior), 'state_update' returns only state update events.
lifecycle, run_modes, state_update Response
Success
The server will send a stream of events in SSE format.
Example event:
id: 1
event: message
data: {}

