API

Streaming

How SSE streaming works, what delta fields Routera emits, and what the final chunk contains.

Public base URL

Routera publishes the API at https://routera.one/api/v1.

Routera supports streaming chat completions over Server-Sent Events.

SSE format

Set stream: true:

curl https://routera.one/api/v1/chat/completions \
  -H "Authorization: Bearer rta_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.5",
    "stream": true,
    "messages": [
      { "role": "user", "content": "Explain SSE in one paragraph." }
    ]
  }'

The response is a text event stream ending with:

data: [DONE]

Stream deltas

Routera currently emits chunk payloads shaped like OpenAI streaming responses. Deltas may contain:

FieldMeaning
choices[0].delta.contentAssistant text delta
choices[0].delta.reasoningReasoning delta when present
choices[0].finish_reasonnull until completion

Final chunk

The final non-error chunk includes:

  • finish_reason: "stop"
  • usage counters
  • reasoning token counts when available
  • cost, duration_ms, and tokens_per_second in the usage payload

If the upstream provider errors during streaming, Routera emits an error chunk before sending [DONE].