BIFROST
Dashboard

Streaming

Stream chat completions in real-time using Server-Sent Events.

Usage

Set stream: true in your request:

Request
{
  "model": "bifrost/auto",
  "messages": [
    { "role": "user", "content": "Write a story" }
  ],
  "stream": true
}

Stream format

Each chunk is a Server-Sent Event with JSON data:

Response chunks
data: {"choices":[{"delta":{"role":"assistant"}}]}

data: {"choices":[{"delta":{"content":"Hello"}}]}

data: {"choices":[{"delta":{"content":"!"}}]}

data: [DONE]
tip
The OpenAI SDK handles streaming automatically. Use client.chat.completions.create({stream: true}) for automatic streaming.
← Previous
Chat Completions
Next →
Models