Backend and APIs · Protocol

Server-Sent Events (SSE)

A simple way for a server to stream updates to a browser over one long HTTP response, used for live feeds, notifications and AI answers that appear word by word.

Realtime · Free · updated

How it works

The browser opens a connection with the EventSource API, and the server keeps the response open, writing short text messages (content type text/event-stream) whenever something happens. If the connection drops, the browser reconnects on its own and can tell the server the last event it received. Data flows one way only; the browser still sends anything of its own with normal requests.

Because it is plain HTTP, SSE passes through most proxies, CDNs and load balancers and needs no special server. The OpenAI, Anthropic and Gemini APIs stream model output this way. Over HTTP/1.1 a browser allows only about six open connections per site across all tabs, a limit HTTP/2 removes, and messages are text only.

Server-Sent Events (SSE) pros and cons

Pros

  • Simpler than WebSockets for one-way updates
  • Automatic reconnection built into the browser
  • Plain HTTP, so it works with most hosts and proxies

Cons

  • Server to client only, with no messages from the browser
  • Text only, and HTTP/1.1 limits open connections per site

When to use Server-Sent Events (SSE)

Pick it when

  • Streaming AI responses, logs or progress to a browser
  • Live scores, feeds and notifications

Skip it when

  • The client also needs to send frequent messages (use WebSockets)

Server-Sent Events (SSE) pricing

Free

Free: part of the web platform.

Approximate, checked September 2026.What the other tools cost

Server-Sent Events (SSE) vs the alternatives

More in Backend and APIs

Realtime

All 26 Backend and APIs terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.