← All terms

Server-Sent Events

A web standard for streaming a one-way sequence of updates from a server to a client over one connection.

Server-Sent Events

Server-Sent Events, commonly abbreviated SSE, is a web standard that lets a server push a stream of text-based updates to a client over a single, long-lived HTTP connection. Unlike a typical HTTP request and response, where the connection closes once the response is delivered, an SSE connection stays open, and the server sends new events down it as they become available, until either side closes the connection.

How it works

A client opens an SSE connection with a standard HTTP request, and the server responds with a special content type that keeps the connection open rather than ending it. The server then writes a sequence of discrete events to that connection, each formatted as plain text, and the client's SSE implementation parses them as they arrive and delivers them to application code incrementally. Because SSE is built directly on HTTP, it works through standard infrastructure such as reverse proxies and load balancers with little special handling, and browsers include built-in support for consuming it without extra libraries.

SSE vs WebSocket

SSE and WebSocket both allow a server to push data to a client without the client repeatedly polling, but SSE is one-way: only the server sends events, and the client cannot send data back over the same connection. WebSocket is bidirectional, allowing both sides to send messages at any time. SSE is generally the simpler choice when a system only needs to stream updates outward, such as progress or output, while WebSocket suits cases that need two-way interaction, such as an interactive terminal.

Why it matters for AI agent systems

AI agents often produce output incrementally, generating a response or a stream of reasoning and actions over time rather than all at once. Waiting for a task to finish before showing any output would make a long-running agent feel unresponsive. SSE lets a client subscribe to an agent's task and receive its output as it is produced, token by token or step by step, which is a natural fit for the one-way, server-to-client nature of streaming a model's output.

Server-Sent Events in Agenhood

Agenhood exposes an SSE stream for live task output alongside its REST API, so a client can submit a task and watch the agent's output arrive incrementally rather than polling for a finished result.

Get started

Deploy your fleet.

Put a fleet of sandboxed agents to work on your own infrastructure, provisioned in seconds and watched live from one console.

Get started

Admin-provisioned · Self-host in one command · Your data never leaves your VM