Topic
Server-Sent Events (SSE) Streaming Deep Dive
14 posts on server-sent events (sse) streaming deep dive — part of api integration on the n4n AI blog.
Why LLM APIs use SSE instead of chunked plain text
Explains why LLM APIs use SSE instead of chunked plain text, covering protocol framing, structured streaming, client ergonomics, and tradeoffs for engineers.
Understanding backpressure in SSE token streaming
Backpressure in SSE token streaming is flow control between LLM server and client. This explainer covers how it works, why it matters, and pitfalls for engineers.
Turn an SSE stream into a JavaScript async iterator
Learn how to wrap a Server-Sent Events feed in a JavaScript async iterator to consume LLM streams cleanly with for-await-of loops step by step.
Streaming partial tool calls over SSE in chat completions
Step-by-step guide to sse streaming partial tool calls in chat completions: parse Server-Sent Events, reconstruct tool arguments, and verify streams.
SSE timeout and keep-alive settings for long LLM responses
Practical guide to tuning SSE timeout and keep-alive settings for long LLM responses, with client code, proxy pitfalls, and retry strategies.
SSE buffering pitfalls behind nginx and proxies
A practical guide to avoiding sse buffering nginx proxy issues: disable proxy buffering, set correct headers, and debug stalled LLM token streams.
Reconnecting dropped SSE streams with Last-Event-ID
Learn how to implement SSE reconnect with Last-Event-ID to resume dropped LLM streaming connections reliably, with runnable code examples.
Parsing the data: field in an OpenAI SSE stream
Learn how to implement robust openai sse data field parsing for streaming LLM responses: buffer events, extract data lines, handle [DONE], and verify.
Handling the [DONE] marker in OpenAI streaming responses
Learn how to correctly parse the OpenAI [DONE] marker in Server-Sent Events streams, with runnable Python and TypeScript code for robust LLM integrations.
Debugging SSE connections with browser dev tools
Learn how to debug SSE connections dev tools in the browser: inspect live streams, replay events, and fix broken Server-Sent Events integrations step by step.
SSE vs WebSockets for streaming chat completions
A head-to-head comparison of SSE vs WebSockets for streaming chat completions across capabilities, cost, latency, ergonomics, and limits, with a verdict.
How server-sent events work for LLM token streaming
Server-sent events (SSE) stream LLM tokens over HTTP. Understand how SSE works for LLM token streaming: wire format, client code, and common pitfalls.
Comparing SSE streaming across OpenAI, Anthropic, and n4n
Head-to-head sse streaming openai anthropic n4n comparison: SSE shapes, cost, latency, ergonomics, limits, and a verdict for engineers.
Building a browser EventSource client for chat streaming
Learn to build an eventsource browser chat streaming client with a tiny SSE server, handling reconnection, parsing, and CORS for real chat apps.
More topics in api integration
- Function Calling Fundamentals27
- Structured Outputs & JSON Mode19
- cURL LLM API Cookbook15
- Integrating GPT-5, Claude Opus 4.8, Gemini 3, Llama 4 & More via One API15
- Next.js AI Chat Integration (App Router + Vercel AI SDK)15
- FastAPI LLM Backend Integration14
- Go net/http LLM API Client14
- LangChain + OpenAI-Compatible Gateway Integration14
- Node.js OpenAI-Compatible SDK Integration14
- Python + OpenAI-Compatible SDK Integration14
- Rate Limits, Retries & Backoff Strategies14
- React Streaming Chat UI Patterns14