Skip to main content
Set stream: true to receive an OpenAI-compatible Server-Sent Events stream from a Dari Router endpoint.

Request

curl https://routing.dari.dev/rtr_123/chat/completions \
  -H "Authorization: Bearer $DARI_ROUTING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dari/routing",
    "stream": true,
    "messages": [
      {"role": "user", "content": "Draft a short release announcement."}
    ]
  }'

First Chunk

The first stream chunk includes routing metadata so clients can record the selected model before content deltas arrive.
data: {"id":"chatcmpl-req_123","object":"chat.completion.chunk","model":"openai/gpt-5.5","choices":[{"index":0,"delta":{},"finish_reason":null}],"dari_routing":{"requested_model":"dari/routing","selected_model":"openai/gpt-5.5","reason":"The request is a concise writing task."}}
Subsequent chunks follow the standard OpenAI chat completion chunk shape and end with:
data: [DONE]

Client Notes

Use the same streaming client you use for OpenAI-compatible chat completions. Read dari_routing from the first chunk if you need to log routing decisions.