Stream chat completion responses token by token using server-sent events.WhollyAPI supports streaming responses via server-sent events (SSE), the same protocol as OpenAI. Set
stream: true in your request to enable it.
Examples
SSE format
Each streamed chunk is adata: line containing a JSON object:
[DONE] contains usage information.
Notes
- Streaming works for all supported models
- Usage stats are available in the last chunk (when
finish_reasonis set) - The
completion_tokensandprompt_tokenscounts are the same as non-streaming
