Events
Every event has anevent: line with its type and a data: line with a JSON object that repeats the type and carries a sequence_number. A text answer produces:
response.createdresponse.output_item.added, thenresponse.content_part.addedresponse.output_text.delta, many timesresponse.output_text.done,response.content_part.done,response.output_item.doneresponse.completed, with the full response and itsusage
response.function_call_arguments.delta and .done for tool calls, response.reasoning_summary_text.delta and response.reasoning_text.delta for reasoning, and response.web_search_call.in_progress, .searching and .completed for search.
The stream ends with response.completed, response.incomplete (for example at max_output_tokens) or response.failed. There is no data: [DONE] line. If a provider fails after the stream has started, an error event arrives before response.failed.