HTTP API

OpenAI compatibility is the contract: request, response and streaming shapes match the OpenAI API so any OpenAI SDK works unmodified.

Streaming

routsi supports both a plain sync response and "stream": true (standard OpenAI SSE chunks). On a streaming request it also sends SSE comment lines — : ping — roughly every 15 seconds (configurable via stream_heartbeat, 0 disables them), so a long agent or worker turn doesn't get dropped by an idle proxy/load-balancer timeout.

what a slow stream looks like on the wire
data: {"choices":[{"delta":{"content":"thinking"}}]}

: ping

: ping

data: {"choices":[{"delta":{"content":" ...done"}}]}

data: [DONE]

Because : ping lines are SSE comments (not data: events), the OpenAI SDK's stream parser silently skips them — no client-side changes needed.

Next: Scenarios →