Skip to content
Rapid Router
Guides · Build

Streaming

Server-sent events in the standard chunk shape, ending with a usage chunk that carries the billed cost.

Set "stream": true for server-sent events. Deltas arrive in the standard chunk shape and the stream terminates with data: [DONE]. A final usage chunk carries the billed cost.

sse
data: {"object":"chat.completion.chunk","model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{"content":"Rou"},"finish_reason":null}]}
data: {"object":"chat.completion.chunk","model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{"content":"ting"},"finish_reason":null}]}
data: {"object":"chat.completion.chunk","model":"anthropic/claude-sonnet-5","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":18,"completion_tokens":96,"total_tokens":114,"cost":0.00074}}
data: [DONE]