Public preview: This API is in public preview. Endpoints, schemas, and limits may change before general availability.
Streaming events
Every SSE event type emitted by /v1/responses, with payload shapes and ordering guarantees.
Streaming responses are Server-Sent Events. Every event has a type field that identifies its shape, and a sequence_number that goes up by one with every event of the response.
This page lists every event type you can receive from /v1/responses.
Event envelope#
event: message
data: { "type": "<event-name>", "sequence_number": <int>, … }
The event: line is message; discrimination happens on the JSON type field — the same convention the OpenAI Responses API uses. In the rare case that the stream itself breaks down, the last event has an event: error line (see error). Lines end with \r\n, and : ping comment lines arrive every 15 seconds; see Streaming.
A typical answer without tools produces:
response.created (1)
response.output_item.added (2) the assistant message
response.content_part.added (3)
response.output_text.delta (4 … n-2)
response.output_text.done (n-1)
response.completed (n)
Lifecycle events#
response.created#
The first event of every response, with sequence_number 1. Carries the response metadata.
{
"type": "response.created",
"sequence_number": 1,
"response": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"object": "response",
"created_at": 1793577600,
"status": "in_progress",
"output": [],
"model": "qwen3.5-397b-a17b",
"show_sidebar": false
}
}
created_at is in Unix epoch seconds. show_sidebar is used by the web app; you can ignore it.
response.completed#
The final event of a successful response. Carries the final answer, the output items, and, when the answer is based on your documents, the passages it cites.
{
"type": "response.completed",
"sequence_number": 42,
"response": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"object": "response",
"created_at": 1793577612,
"status": "completed",
"output": [
{
"id": "msg_550e8400-e29b-41d4-a716-446655440000",
"type": "message",
"role": "assistant",
"content": [{ "type": "output_text", "text": "Server costs rose 12% in Q3 [1]." }]
}
],
"model": "qwen3.5-397b-a17b",
"output_text": "Server costs rose 12% in Q3 [1].",
"show_sidebar": true,
"sources": [
{
"rank": 1,
"score": 0.82,
"text": "Q3 hosting expenses increased by 12% compared to Q2 …",
"metadata": {
"type": "file",
"source": "audit-2024.pdf",
"file_id": "123e4567-e89b-12d3-a456-426614174000",
"page_number": 14,
"heading": "Infrastructure costs"
}
}
]
}
}
outputlists the assistant message first, then the tool calls the model made (seeresponse.output_item.done).output_textis the final answer: the text the model wrote after its last tool call.sourcesis present when passages from your files or an agent’s files were used. A citation such as[1]in the text refers to the source with thatrank.
After this event the stream closes.
response.incomplete#
Sent instead of response.completed when the answer was cut off because it reached max_output_tokens. Same shape, with status: "incomplete" and a reason:
{
"type": "response.incomplete",
"sequence_number": 1027,
"response": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "incomplete",
"output_text": "The first part of the answer …",
"incomplete_details": { "reason": "max_output_tokens" },
…
}
}
error#
The response failed. Treat the response as failed when you receive this event, even if a response.completed event still follows it.
{
"type": "error",
"sequence_number": 17,
"code": "model_error",
"message": "No response received from model"
}
code | Meaning |
|---|---|
model_error | The model failed or did not answer. Usually worth a retry. |
chain_error | An internal error in EU GPT. Retry once. |
stream_error | The stream itself broke down. This event comes with an event: error line and has no sequence_number. Retry once. |
See Errors for errors that are returned before the stream starts.
Text events#
response.output_item.added (message)#
Right after response.created, the assistant message starts:
{
"type": "response.output_item.added",
"sequence_number": 2,
"output_index": 0,
"item": {
"id": "msg_550e8400-e29b-41d4-a716-446655440000",
"type": "message",
"status": "in_progress",
"role": "assistant"
}
}
There is no matching response.output_item.done for the message; it ends with the response.
response.content_part.added#
The text part of the message begins.
{
"type": "response.content_part.added",
"sequence_number": 3,
"item_id": "msg_550e8400-e29b-41d4-a716-446655440000",
"output_index": 0,
"content_index": 0,
"part": { "type": "output_text" }
}
response.output_text.delta#
Incremental text chunk. Append delta to the text you have so far.
{
"type": "response.output_text.delta",
"sequence_number": 4,
"item_id": "msg_550e8400-e29b-41d4-a716-446655440000",
"output_index": 0,
"content_index": 0,
"delta": "Hello"
}
You will receive many of these per response — typically one per token or small token group. Append deltas in the order they arrive; do not group them by output_index, which can change after a tool call.
response.output_text.done#
Marks a stretch of text as complete, with the full text of that stretch.
{
"type": "response.output_text.done",
"sequence_number": 41,
"item_id": "msg_550e8400-e29b-41d4-a716-446655440000",
"output_index": 0,
"content_index": 0,
"text": "Hello, world."
}
When the model writes something before it calls a tool (for example “Let me look that up.”), that text gets its own response.output_text.done, and the final answer gets another one later. In rare cases the final text differs slightly from the deltas, for example when EU GPT removes a broken link, so treat the text of the last output_text.done, or output_text in response.completed, as the final answer.
Tool-call events#
response.output_item.added#
The model has decided to call a tool. See Tools for the tool names.
{
"type": "response.output_item.added",
"sequence_number": 5,
"output_index": 1,
"item": {
"id": "fc_call_8a1f2c3d",
"type": "function_call",
"status": "in_progress",
"name": "web_search",
"call_id": "call_8a1f2c3d",
"arguments": "{\"query\":\"…\"}"
}
}
response.output_item.done#
The tool has finished. The item now carries the tool’s output and a final status.
{
"type": "response.output_item.done",
"sequence_number": 6,
"output_index": 1,
"item": {
"id": "fc_call_8a1f2c3d",
"type": "function_call",
"status": "completed",
"name": "web_search",
"call_id": "call_8a1f2c3d",
"arguments": "{\"query\":\"…\"}",
"output": "Found 5 results for \"…\": …"
}
}
statusiscompletedorfailed.outputis text written for the model. Show it if you like, but do not parse it.- Match
addedanddoneevents bycall_id. When the model calls several tools at once, theiroutput_indexvalues do not always match.
File events#
response.file.generated#
A tool created a file, such as a PDF report. Sent after the answer text, before response.completed.
{
"type": "response.file.generated",
"sequence_number": 40,
"file": {
"call_id": "call_4be9d1a7",
"tool_name": "generate_pdf",
"key": "8f14e45f-ceea-467a-a4ed-a9e9a5cb16ee/q3-report.pdf",
"filename": "q3-report.pdf",
"size": 48213,
"content_type": "application/pdf"
}
}
Download it with GET /v1/files/generated/{key}; see Tools.
Model events#
response.model.fallback#
The model you named did not start answering within 45 seconds, so EU GPT continues with another model. routing_model is the model that takes over.
{
"type": "response.model.fallback",
"sequence_number": 4,
"message": "qwen3.6-35b-a3b did not start answering; continuing with qwen3.5-397b-a17b",
"routing_model": "qwen3.5-397b-a17b"
}
Events you may see in the future#
The schema is designed to be additive. Clients should ignore unknown event types and unknown fields rather than fail. We may add new events (e.g. partial usage reporting) without bumping the API version, as long as they do not change the meaning of existing events.
Ordering guarantees#
response.createdis always first, withsequence_number1.sequence_numberincreases by exactly one per event within a response.- The stream ends with
response.completed,response.incomplete, orerror. Anerrorevent means the response failed, even when aresponse.completedevent follows it. - For a tool call,
response.output_item.addedcomes before itsresponse.output_item.done. response.file.generatedevents come after the answer text and before the last event.