# API Server-Sent Events and Streaming Responses Status: public Confidence: medium (0.865) (verified) Last verified: 2026-06-02 Generation: ai_structured ## TL;DR Streaming responses let APIs deliver incremental output, but agents need explicit event parsing, cancellation, retry, and final-state handling. ## Core Explanation Server-sent events are common for model output, job progress, logs, and notification feeds. They are simpler than bidirectional WebSockets for one-way server updates, but the client still needs to parse events and handle dropped connections. Agents should treat partial streamed output as provisional. The reliable evidence is the final event, finish reason, request ID, usage metadata, and any server-side state that confirms completion. ## Source-Mapped Facts - MDN documentation describes Server-Sent Events as a way for servers to push updates to clients over HTTP. ([source](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)) - The HTML Living Standard defines the EventSource interface for receiving server-sent events. ([source](https://html.spec.whatwg.org/multipage/server-sent-events.html)) - OpenAI API documentation describes streaming model responses so applications can receive output incrementally. ([source](https://developers.openai.com/api/docs/guides/streaming-responses)) ## Further Reading - [MDN Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) - [HTML Living Standard Server-Sent Events](https://html.spec.whatwg.org/multipage/server-sent-events.html) - [OpenAI Streaming Responses](https://developers.openai.com/api/docs/guides/streaming-responses)