/v1/chat/completions endpoint. Unlike simulated streaming, this delivers tokens to the client as they are generated.
The streaming endpoint follows the OpenAI API specification, making it compatible with existing OpenAI client libraries and tools.
Why SSE Streaming?
- Real-time delivery - Tokens stream to the client as they’re generated
- Reduced perceived latency - Users see responses immediately, not after full generation
- Native browser support - SSE works out of the box with EventSource API
- OpenAI compatibility - Drop-in replacement for OpenAI streaming endpoints
How It Works
The streaming architecture connects your workflow directly to the HTTP response:The Streaming Endpoint
The endpoint accepts OpenAI-compatible chat completion requests and returns an SSE stream:/v1 prefix by app/launchpad/api/router.py, so the full path is POST /v1/chat/completions.
Example Workflow
TheExampleStreamingWorkflow (registered as WorkflowRegistry.STREAMING) demonstrates a two-node streaming pipeline:
Streaming Node Examples
Text Streaming
Stream plain text responses token by token:Structured Streaming
Stream structured Pydantic model outputs:Testing the Endpoint
Use curl to test the streaming endpoint:Key Features
- Delta extraction - Only sends new tokens, not the full accumulated text
- Debouncing - Configurable delay (default 10ms) to batch rapid updates
- OpenAI chunk format - Compatible with standard OpenAI client libraries
- Multi-node streaming - Chain multiple streaming nodes in a single workflow
- Langfuse tracing - Full observability with
enable_tracing=True