OpenAI Chat Completions — Event Reference
This page documents the streaming frames emitted by POST /api/openai/v1/chat/completions when stream: true.
Frame shape
Each line is an SSE data: JSON object.
Notes:
- Initial chunk includes
role: "assistant". - Text arrives via
choices[0].delta.content. - Tool calling deltas use
choices[0].delta.tool_calls[].function.arguments. - The terminal chunk sets
finish_reasontostop,length, ortool_calls. - When
stream_options.include_usageis true, an extra usage-only chunk precedes[DONE].