Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

WebSocket events

Send client events and receive server events over a persistent Responses API WebSocket connection. Learn more about WebSocket mode.

Client events

Events sent by the client over a Responses API WebSocket connection.

response.create

Client event for creating a response over a persistent WebSocket connection. This payload uses the same top-level fields as POST /v1/responses, plus WebSocket-only envelope metadata.

Notes:

  • stream is implicit over WebSocket and should not be sent.
  • background is not supported over WebSocket.
  • stream_id is WebSocket-only and is not part of POST /v1/responses.
type: "response.create"

The type of the client event. Always response.create.

access_programs: optional object { cyber }

Domain-specific access programs to use for this request.

background: optional boolean or null (default: false)

Whether to run the model response in the background. Learn more.

context_management: optional array of object { type, compact_threshold } or null

Context management configuration for this request.

minItems1
type: string

The context management entry type. Currently only 'compaction' is supported.

compact_threshold: optional integer or null

Token threshold at which compaction should be triggered for this entry.

minimum1000
conversation: optional string or ResponseConversationParam { id } or null

The conversation that this response belongs to. Items from this conversation are prepended to input_items for this response request. Input items and output items from this response are automatically added to this conversation after this response completes.

generate: optional boolean

Whether to generate output for this response. Defaults to true when omitted. Set to false to prepare request state without model output; the response ID can be used as previous_response_id on a later turn.

image: optional object { context_compression }

Request level image options.

include: optional array of ResponseIncludable or null

Specify additional output data to include in the model response. Currently supported values are:

  • web_search_call.action.sources: Include the sources of the web search tool call.
  • code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.
  • computer_call_output.output.image_url: Include image urls from the computer call output.
  • file_search_call.results: Include the search results of the file search tool call.
  • message.input_image.image_url: Include image urls from the input message.
  • message.output_text.logprobs: Include logprobs with assistant messages.
  • reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).
input: optional string or array of EasyInputMessage { content, role, phase, type } or Message { content, role, status, type } or ResponseOutputMessage { id, content, role, 3 more } or 30 more

Text, image, or file inputs to the model, used to generate a response.

Learn more:

instructions: optional string or null

A system (or developer) message inserted into the model's context.

When using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

max_output_tokens: optional integer or null

An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.

minimum16
max_tool_calls: optional integer or null

The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.

metadata: optional Metadata or null

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

model: optional ResponsesModel

Model ID used to generate the response, like gpt-6-astra. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.

moderation: optional object { model, policy } or null

Configuration for running moderation on the input and output of this response.

parallel_tool_calls: optional boolean or null (default: true)

Whether to allow the model to run tool calls in parallel.

previous_response_id: optional string or null

The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with conversation.

prompt: optional ResponsePrompt { id, variables, version } or null

Reference to a prompt template and its variables. Learn more.

prompt_cache_key: optional string or null

Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the user field. Learn more.

prompt_cache_options: optional object { comparison_response_id, mode, prewarm, ttl }

Options for prompt caching. Supported for gpt-5.6 and later models. By default, OpenAI automatically chooses one implicit cache breakpoint. You can add explicit breakpoints to content blocks with prompt_cache_breakpoint. Each request can write up to four breakpoints. For cache matching, OpenAI considers up to the latest 80 breakpoints in the conversation, without a content-block lookback limit. Set mode to explicit to disable the implicit breakpoint. The ttl defaults to 30m. Supported lifetimes depend on the API. See the prompt caching guide for current details.

prompt_cache_retention: optional "in_memory" or "24h" or null

Deprecated.

Deprecated. Use prompt_cache_options.ttl instead.

The retention policy for the prompt cache. Set to 24h to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. This field expresses a maximum retention policy, while prompt_cache_options.ttl expresses a minimum cache lifetime. The two fields are independent and do not interact. For gpt-5.5, gpt-5.5-pro, and future models, only 24h is supported.

For older models that support both in_memory and 24h, the default depends on your organization's data retention policy:

  • Organizations without ZDR enabled default to 24h.
  • Organizations with ZDR enabled default to in_memory when prompt_cache_retention is not specified.
One of the following:
"in_memory"
"24h"
reasoning: optional Reasoning { context, effort, generate_summary, 2 more } or null

Configuration options for reasoning models.

safety_identifier: optional string or null

A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user, with a maximum length of 128 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.

maxLength128
service_tier: optional ServiceTier or null (default: "auto")

Specifies the processing type used for serving the request.

  • If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'.
  • If set to 'default', then the request will be processed with the standard pricing and performance for the selected model.
  • If set to 'flex', then the request will be processed with the Flex Processing service tier.
  • To opt-in to Fast mode at the request level, include the service_tier=fast or service_tier=priority parameter for Responses or Chat Completions. The response will show service_tier=priority regardless of if you specify service_tier=fast or priority in your request.
  • If set to 'ultrafast', then the request will be processed with the access-controlled Ultrafast Processing service tier. This tier is currently available for gpt-5.6-sol; a response served through it will show service_tier=ultrafast.
  • When not set, the default behavior is 'auto'.

When the service_tier parameter is set, the response body will include the service_tier value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.

store: optional boolean or null (default: true)

Whether to store the generated model response for later retrieval via API. Defaults to true when omitted. If set to true, response data will be stored for at least 30 days, subject to the data retention exceptions.

stream: optional boolean or null (default: false)

If set to true, the model response data will be streamed to the client as it is generated using server-sent events. See the Streaming section below for more information.

stream_id: optional string

The WebSocket lane for this response. Requests with the same stream_id are processed FIFO, and events for the response echo the same stream_id.

stream_id controls routing; previous_response_id controls conversation lineage, so a new lane can fork from a response created on another lane.

pattern^[A-Za-z0-9_.-]+$
minLength1
maxLength256
stream_options: optional object { include_obfuscation } or null

Options for streaming responses. Only set this when you set stream: true.

include_obfuscation: optional boolean

When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an obfuscation field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set include_obfuscation to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.

temperature: optional number or null (default: 1)

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.

minimum0
maximum2
text: optional ResponseTextConfig { format, verbosity }

Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:

tool_choice: optional ToolChoiceOptions or ToolChoiceAllowed { mode, tools, type } or ToolChoiceTypes { type } or 6 more

How the model should select which tool (or tools) to use when generating a response. See the tools parameter to see how to specify which tools the model can call.

tools: optional array of Function { name, parameters, strict, 6 more } or FileSearch { type, vector_store_ids, filters, 2 more } or Computer { type } or 13 more

An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choice parameter.

We support the following categories of tools:

  • Built-in tools: Tools that are provided by OpenAI that extend the model's capabilities, like web search or file search. Learn more about built-in tools.
  • MCP Tools: Integrations with third-party systems via custom MCP servers or predefined connectors such as Google Drive and SharePoint. Learn more about MCP Tools.
  • Function calls (custom tools): Functions that are defined by you, enabling the model to call your own code with strongly typed arguments and outputs. Learn more about function calling. You can also use custom tools to call your own code.
top_logprobs: optional integer or null

An integer between 0 and 20 specifying the maximum number of most likely tokens to return at each token position, each with an associated log probability. In some cases, the number of returned tokens may be fewer than requested.

minimum0
maximum20
top_p: optional number or null (default: 1)

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

minimum0
maximum1
truncation: optional "auto" or "disabled" or null (default: "disabled")

Deprecated.

The truncation strategy to use for the model response.

  • auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. On some models, trimming can begin earlier because the API subtracts the model's maximum output allowance from its input limit, even if you set a lower max_output_tokens.
  • disabled (default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
One of the following:
"auto"
"disabled"
user: optional string or null

Deprecated.

This field is being replaced by safety_identifier and prompt_cache_key. Use prompt_cache_key instead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.

response.steer

Queues user input to steer a response on this WebSocket connection. Input can contain text, images, and files. Steering is supported only for single-agent responses on models and execution modes that support steering. Responses bound to a conversation or using automatic compaction do not support steering.

A response.steer.accepted event acknowledges that the server owns the queued input, not that it has been applied. The successor's response.created event is the commit point. Input that cannot be committed is returned in response.steer.failed.

Steering may cause the active response to finish at a safe output boundary with response.incomplete and incomplete_details.reason set to steered, followed automatically by a successor response.created. Normal completion can also be followed by an automatic successor. Automatic successors inherit the previous response's settings and continue from it with the queued input.

If the response stops for client-owned tool output or approval, accepted steering input remains queued and response.steer.pending is emitted after response.completed. Fill the required_input stubs from that event with saved tool results or approval decisions, and send one explicit response.create per parent with the same previous_response_id and WebSocket lane. Do not rerun tools or resend accepted steering input. The queued input is prepended in submission order to that request's input, and the explicit request retains its own settings.

This event accepts only type, previous_response_id, and input. Do not send stream_id; the target response determines the WebSocket lane.

Input to queue for a continuation of the response. Uses the same string or input-item shape as response.create.input, with a non-empty array when supplying input items.

Steering accepts only messages with the user role. Each message may contain only type, role, and content, with content as a string or an array of input_text, input_image, and input_file parts. The optional type must be message. Other roles, tool outputs, and item types are not supported for steering.

previous_response_id: string

The ID of the response to steer on this WebSocket connection.

type: "response.steer"

The event discriminator. Always response.steer.

Server events (WebSocket only)

Events emitted only over a Responses API WebSocket connection.

response.steer.accepted

Emitted when steering input has been validated and queued. Acceptance means the server owns the input, not that it has been applied. The successor's response.created event is the commit point. If accepted input cannot be committed, response.steer.failed returns it with the same steering ID.

When the response stops for client-owned tool output or approval, the input remains queued and response.steer.pending is emitted after response.completed. Fill the pending event's required_input stubs with saved results and send one matching explicit response.create per parent. Do not resend accepted input while it is still queued.

sequence_number: integer

The sequence number for this event.

steer: object { id, previous_response_id }

The accepted steering submission.

id: string

The ID assigned to the steering submission.

previous_response_id: string

The ID of the response being steered.

type: "response.steer.accepted"

The event discriminator. Always response.steer.accepted.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the target response's response.create event supplied a stream_id.

response.steer.pending

Emitted when accepted steering input remains queued after the target response completes. The server still owns the input. Do not resend it. The successor's response.created event is the commit point.

When reason is waiting_for_required_input, this event follows response.completed while the response waits for the tool results or approval decisions identified by required_input. Copy those stubs, fill their result fields using the ordinary response.create input schemas, and submit one continuation per parent with the same previous_response_id and WebSocket lane. Use saved results without rerunning tools. The queued steering input is prepended in submission order to the continuation's input. That explicit request retains its own settings.

This notification is emitted at most once per steering submission. Multiple submissions for the same parent can report the same required inputs; they do not each require a separate continuation.

An extensible enum describing why accepted steering input is still queued. Clients should handle unknown values because additional reasons may be introduced. Known values include:

  • waiting_for_required_input: The response is waiting for the tool results or approval decisions identified by required_input.
required_input: array of ResponseSteerRequiredInput

Input stubs identifying outstanding client-owned tool results or approval decisions. Each stub contains identifying fields only; the client supplies the result before including it in response.create.

minItems1
sequence_number: integer

The sequence number for this event.

steer: object { id, previous_response_id }

The steering submission that remains queued.

id: string

The ID assigned to the steering submission.

previous_response_id: string

The ID of the response being steered.

type: "response.steer.pending"

The event discriminator. Always response.steer.pending.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the target response's response.create event supplied a stream_id.

response.steer.failed

Emitted when steering input is rejected or cannot be committed to a successor response. Returns the original, uncommitted input so the client can carry it into response.create when appropriate. Invalid input must be corrected before retrying.

Failures after acceptance include the same steering ID. Failures before an ID is allocated omit steer.id. A lost connection or missing acknowledgement leaves the outcome unknown; it is not proof that the input was rejected.

error: object { code, message, type }

Information about why the input could not be committed.

sequence_number: integer

The sequence number for this event.

steer: object { input, previous_response_id, id }

The steering submission that could not be committed.

type: "response.steer.failed"

The event discriminator. Always response.steer.failed.

stream_id: optional string

The WebSocket lane that emitted this event, when the target response is available and its response.create event supplied a stream_id.

error

Emitted when an error occurs while processing a Responses WebSocket request.

error: object { code, message, param, 3 more }

Details about the error.

type: "error"

The type of the event. Always error.

sequence_number: optional integer

The sequence number of an error emitted by the response stream.

status: optional integer

The HTTP status code associated with a WebSocket protocol error.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

Server events

These events use the same payloads over WebSocket and HTTP streaming. Compaction progress follows the same cadence and output-item lifecycle described in HTTP streaming.

response.created

An event that is emitted when a response is created.

response: Response { id, access_programs, created_at, 36 more }

The response that was created.

sequence_number: integer

The sequence number for this event.

type: "response.created"

The type of the event. Always response.created.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.in_progress

Emitted when the response is in progress.

response: Response { id, access_programs, created_at, 36 more }

The response that is in progress.

sequence_number: integer

The sequence number of this event.

type: "response.in_progress"

The type of the event. Always response.in_progress.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.completed

Emitted when the model response is complete.

response: Response { id, access_programs, created_at, 36 more }

Properties of the completed response.

sequence_number: integer

The sequence number for this event.

type: "response.completed"

The type of the event. Always response.completed.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.failed

An event that is emitted when a response fails.

response: Response { id, access_programs, created_at, 36 more }

The response that failed.

sequence_number: integer

The sequence number of this event.

type: "response.failed"

The type of the event. Always response.failed.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.incomplete

An event that is emitted when a response finishes as incomplete.

Over WebSocket, steering can finish a response with response.incomplete_details.reason set to steered, followed automatically by a successor response.created that commits the queued steering input.

response: Response { id, access_programs, created_at, 36 more }

The response that was incomplete.

sequence_number: integer

The sequence number of this event.

type: "response.incomplete"

The type of the event. Always response.incomplete.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.output_item.added

Emitted when a new output item is added.

The output item that was added. For reasoning items, encrypted_content may be incomplete while the item is in progress. Use the reasoning item from the corresponding response.output_item.done event when passing it as input to a subsequent request.

output_index: integer

The index of the output item that was added.

sequence_number: integer

The sequence number of this event.

type: "response.output_item.added"

The type of the event. Always response.output_item.added.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.output_item.done

Emitted when an output item is marked done.

The output item that was marked done.

output_index: integer

The index of the output item that was marked done.

sequence_number: integer

The sequence number of this event.

type: "response.output_item.done"

The type of the event. Always response.output_item.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.content_part.added

Emitted when a new content part is added.

content_index: integer

The index of the content part that was added.

item_id: string

The ID of the output item that the content part was added to.

output_index: integer

The index of the output item that the content part was added to.

part: ResponseOutputText { annotations, logprobs, text, type } or ResponseOutputRefusal { refusal, type } or ReasoningText { text, type }

The content part that was added.

sequence_number: integer

The sequence number of this event.

type: "response.content_part.added"

The type of the event. Always response.content_part.added.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.content_part.done

Emitted when a content part is done.

content_index: integer

The index of the content part that is done.

item_id: string

The ID of the output item that the content part was added to.

output_index: integer

The index of the output item that the content part was added to.

part: ResponseOutputText { annotations, logprobs, text, type } or ResponseOutputRefusal { refusal, type } or ReasoningText { text, type }

The content part that is done.

sequence_number: integer

The sequence number of this event.

type: "response.content_part.done"

The type of the event. Always response.content_part.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.output_text.delta

Emitted when there is an additional text delta.

content_index: integer

The index of the content part that the text delta was added to.

delta: string

The text delta that was added.

item_id: string

The ID of the output item that the text delta was added to.

logprobs: array of object { token, logprob, top_logprobs }

The log probabilities of the tokens in the delta.

output_index: integer

The index of the output item that the text delta was added to.

sequence_number: integer

The sequence number for this event.

type: "response.output_text.delta"

The type of the event. Always response.output_text.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.output_text.done

Emitted when text content is finalized.

content_index: integer

The index of the content part that the text content is finalized.

item_id: string

The ID of the output item that the text content is finalized.

logprobs: array of object { token, logprob, top_logprobs }

The log probabilities of the tokens in the delta.

output_index: integer

The index of the output item that the text content is finalized.

sequence_number: integer

The sequence number for this event.

text: string

The text content that is finalized.

type: "response.output_text.done"

The type of the event. Always response.output_text.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.refusal.delta

Emitted when there is a partial refusal text.

content_index: integer

The index of the content part that the refusal text is added to.

delta: string

The refusal text that is added.

item_id: string

The ID of the output item that the refusal text is added to.

output_index: integer

The index of the output item that the refusal text is added to.

sequence_number: integer

The sequence number of this event.

type: "response.refusal.delta"

The type of the event. Always response.refusal.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.refusal.done

Emitted when refusal text is finalized.

content_index: integer

The index of the content part that the refusal text is finalized.

item_id: string

The ID of the output item that the refusal text is finalized.

output_index: integer

The index of the output item that the refusal text is finalized.

refusal: string

The refusal text that is finalized.

sequence_number: integer

The sequence number of this event.

type: "response.refusal.done"

The type of the event. Always response.refusal.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.function_call_arguments.delta

Emitted when there is a partial function-call arguments delta.

delta: string

The function-call arguments delta that is added.

item_id: string

The ID of the output item that the function-call arguments delta is added to.

output_index: integer

The index of the output item that the function-call arguments delta is added to.

sequence_number: integer

The sequence number of this event.

type: "response.function_call_arguments.delta"

The type of the event. Always response.function_call_arguments.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.function_call_arguments.done

Emitted when function-call arguments are finalized.

arguments: string

The function-call arguments.

item_id: string

The ID of the item.

output_index: integer

The index of the output item.

sequence_number: integer

The sequence number of this event.

type: "response.function_call_arguments.done"
stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.file_search_call.in_progress

Emitted when a file search call is initiated.

item_id: string

The ID of the output item that the file search call is initiated.

output_index: integer

The index of the output item that the file search call is initiated.

sequence_number: integer

The sequence number of this event.

type: "response.file_search_call.in_progress"

The type of the event. Always response.file_search_call.in_progress.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.file_search_call.searching

Emitted when a file search is currently searching.

item_id: string

The ID of the output item that the file search call is initiated.

output_index: integer

The index of the output item that the file search call is searching.

sequence_number: integer

The sequence number of this event.

type: "response.file_search_call.searching"

The type of the event. Always response.file_search_call.searching.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.file_search_call.completed

Emitted when a file search call is completed (results found).

item_id: string

The ID of the output item that the file search call is initiated.

output_index: integer

The index of the output item that the file search call is initiated.

sequence_number: integer

The sequence number of this event.

type: "response.file_search_call.completed"

The type of the event. Always response.file_search_call.completed.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.web_search_call.in_progress

Emitted when a web search call is initiated.

item_id: string

Unique ID for the output item associated with the web search call.

output_index: integer

The index of the output item that the web search call is associated with.

sequence_number: integer

The sequence number of the web search call being processed.

type: "response.web_search_call.in_progress"

The type of the event. Always response.web_search_call.in_progress.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.web_search_call.searching

Emitted when a web search call is executing.

item_id: string

Unique ID for the output item associated with the web search call.

output_index: integer

The index of the output item that the web search call is associated with.

sequence_number: integer

The sequence number of the web search call being processed.

type: "response.web_search_call.searching"

The type of the event. Always response.web_search_call.searching.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.web_search_call.completed

Emitted when a web search call is completed.

item_id: string

Unique ID for the output item associated with the web search call.

output_index: integer

The index of the output item that the web search call is associated with.

sequence_number: integer

The sequence number of the web search call being processed.

type: "response.web_search_call.completed"

The type of the event. Always response.web_search_call.completed.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_summary_part.added

Emitted when a new reasoning summary part is added.

item_id: string

The ID of the item this summary part is associated with.

output_index: integer

The index of the output item this summary part is associated with.

part: object { text, type }

The summary part that was added.

text: string

The text of the summary part.

type: "summary_text"

The type of the summary part. Always summary_text.

sequence_number: integer

The sequence number of this event.

summary_index: integer

The index of the summary part within the reasoning summary.

type: "response.reasoning_summary_part.added"

The type of the event. Always response.reasoning_summary_part.added.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_summary_part.done

Emitted when a reasoning summary part is completed.

item_id: string

The ID of the item this summary part is associated with.

output_index: integer

The index of the output item this summary part is associated with.

part: object { text, type }

The completed summary part.

text: string

The text of the summary part.

type: "summary_text"

The type of the summary part. Always summary_text.

sequence_number: integer

The sequence number of this event.

summary_index: integer

The index of the summary part within the reasoning summary.

type: "response.reasoning_summary_part.done"

The type of the event. Always response.reasoning_summary_part.done.

status: optional "incomplete"

The completion status of the summary part. Omitted when the part completed normally and set to incomplete when generation was interrupted.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_summary_text.delta

Emitted when a delta is added to a reasoning summary text.

delta: string

The text delta that was added to the summary.

item_id: string

The ID of the item this summary text delta is associated with.

output_index: integer

The index of the output item this summary text delta is associated with.

sequence_number: integer

The sequence number of this event.

summary_index: integer

The index of the summary part within the reasoning summary.

type: "response.reasoning_summary_text.delta"

The type of the event. Always response.reasoning_summary_text.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_summary_text.done

Emitted when a reasoning summary text is completed.

item_id: string

The ID of the item this summary text is associated with.

output_index: integer

The index of the output item this summary text is associated with.

sequence_number: integer

The sequence number of this event.

summary_index: integer

The index of the summary part within the reasoning summary.

text: string

The full text of the completed reasoning summary.

type: "response.reasoning_summary_text.done"

The type of the event. Always response.reasoning_summary_text.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_text.delta

Emitted when a delta is added to a reasoning text.

content_index: integer

The index of the reasoning content part this delta is associated with.

delta: string

The text delta that was added to the reasoning content.

item_id: string

The ID of the item this reasoning text delta is associated with.

output_index: integer

The index of the output item this reasoning text delta is associated with.

sequence_number: integer

The sequence number of this event.

type: "response.reasoning_text.delta"

The type of the event. Always response.reasoning_text.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.reasoning_text.done

Emitted when a reasoning text is completed.

content_index: integer

The index of the reasoning content part.

item_id: string

The ID of the item this reasoning text is associated with.

output_index: integer

The index of the output item this reasoning text is associated with.

sequence_number: integer

The sequence number of this event.

text: string

The full text of the completed reasoning content.

type: "response.reasoning_text.done"

The type of the event. Always response.reasoning_text.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.image_generation_call.completed

Emitted when an image generation tool call has completed and the final image is available.

item_id: string

The unique identifier of the image generation item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of this event.

type: "response.image_generation_call.completed"

The type of the event. Always 'response.image_generation_call.completed'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.image_generation_call.generating

Emitted when an image generation tool call is actively generating an image (intermediate state).

item_id: string

The unique identifier of the image generation item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of the image generation item being processed.

type: "response.image_generation_call.generating"

The type of the event. Always 'response.image_generation_call.generating'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.image_generation_call.in_progress

Emitted when an image generation tool call is in progress.

item_id: string

The unique identifier of the image generation item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of the image generation item being processed.

type: "response.image_generation_call.in_progress"

The type of the event. Always 'response.image_generation_call.in_progress'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.image_generation_call.partial_image

Emitted when a partial image is available during image generation streaming.

item_id: string

The unique identifier of the image generation item being processed.

output_index: integer

The index of the output item in the response's output array.

partial_image_b64: string

Base64-encoded partial image data, suitable for rendering as an image.

partial_image_index: integer

0-based index for the partial image (backend is 1-based, but this is 0-based for the user).

sequence_number: integer

The sequence number of the image generation item being processed.

type: "response.image_generation_call.partial_image"

The type of the event. Always 'response.image_generation_call.partial_image'.

background: optional string

The background setting that was used.

output_format: optional string

The output format that was used.

quality: optional string

The image quality that was used.

size: optional string

The image size that was used.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_call_arguments.delta

Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

delta: string

A JSON string containing the partial update to the arguments for the MCP tool call.

item_id: string

The unique identifier of the MCP tool call item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_call_arguments.delta"

The type of the event. Always 'response.mcp_call_arguments.delta'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_call_arguments.done

Emitted when the arguments for an MCP tool call are finalized.

arguments: string

A JSON string containing the finalized arguments for the MCP tool call.

item_id: string

The unique identifier of the MCP tool call item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_call_arguments.done"

The type of the event. Always 'response.mcp_call_arguments.done'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_call.completed

Emitted when an MCP tool call has completed successfully.

item_id: string

The ID of the MCP tool call item that completed.

output_index: integer

The index of the output item that completed.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_call.completed"

The type of the event. Always 'response.mcp_call.completed'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_call.failed

Emitted when an MCP tool call has failed.

item_id: string

The ID of the MCP tool call item that failed.

output_index: integer

The index of the output item that failed.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_call.failed"

The type of the event. Always 'response.mcp_call.failed'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_call.in_progress

Emitted when an MCP tool call is in progress.

item_id: string

The unique identifier of the MCP tool call item being processed.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_call.in_progress"

The type of the event. Always 'response.mcp_call.in_progress'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_list_tools.completed

Emitted when the list of available MCP tools has been successfully retrieved.

item_id: string

The ID of the MCP tool call item that produced this output.

output_index: integer

The index of the output item that was processed.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_list_tools.completed"

The type of the event. Always 'response.mcp_list_tools.completed'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_list_tools.failed

Emitted when the attempt to list available MCP tools has failed.

item_id: string

The ID of the MCP tool call item that failed.

output_index: integer

The index of the output item that failed.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_list_tools.failed"

The type of the event. Always 'response.mcp_list_tools.failed'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.mcp_list_tools.in_progress

Emitted when the system is in the process of retrieving the list of available MCP tools.

item_id: string

The ID of the MCP tool call item that is being processed.

output_index: integer

The index of the output item that is being processed.

sequence_number: integer

The sequence number of this event.

type: "response.mcp_list_tools.in_progress"

The type of the event. Always 'response.mcp_list_tools.in_progress'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.code_interpreter_call.in_progress

Emitted when a code interpreter call is in progress.

item_id: string

The unique identifier of the code interpreter tool call item.

output_index: integer

The index of the output item in the response for which the code interpreter call is in progress.

sequence_number: integer

The sequence number of this event, used to order streaming events.

type: "response.code_interpreter_call.in_progress"

The type of the event. Always response.code_interpreter_call.in_progress.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.code_interpreter_call.interpreting

Emitted when the code interpreter is actively interpreting the code snippet.

item_id: string

The unique identifier of the code interpreter tool call item.

output_index: integer

The index of the output item in the response for which the code interpreter is interpreting code.

sequence_number: integer

The sequence number of this event, used to order streaming events.

type: "response.code_interpreter_call.interpreting"

The type of the event. Always response.code_interpreter_call.interpreting.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.code_interpreter_call.completed

Emitted when the code interpreter call is completed.

item_id: string

The unique identifier of the code interpreter tool call item.

output_index: integer

The index of the output item in the response for which the code interpreter call is completed.

sequence_number: integer

The sequence number of this event, used to order streaming events.

type: "response.code_interpreter_call.completed"

The type of the event. Always response.code_interpreter_call.completed.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.code_interpreter_call_code.delta

Emitted when a partial code snippet is streamed by the code interpreter.

delta: string

The partial code snippet being streamed by the code interpreter.

item_id: string

The unique identifier of the code interpreter tool call item.

output_index: integer

The index of the output item in the response for which the code is being streamed.

sequence_number: integer

The sequence number of this event, used to order streaming events.

type: "response.code_interpreter_call_code.delta"

The type of the event. Always response.code_interpreter_call_code.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.code_interpreter_call_code.done

Emitted when the code snippet is finalized by the code interpreter.

code: string

The final code snippet output by the code interpreter.

item_id: string

The unique identifier of the code interpreter tool call item.

output_index: integer

The index of the output item in the response for which the code is finalized.

sequence_number: integer

The sequence number of this event, used to order streaming events.

type: "response.code_interpreter_call_code.done"

The type of the event. Always response.code_interpreter_call_code.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.output_text.annotation.added

Emitted when an annotation is added to output text content.

annotation: FileCitation { file_id, filename, index, type } or URLCitation { end_index, start_index, title, 2 more } or ContainerFileCitation { container_id, end_index, file_id, 3 more } or FilePath { file_id, index, type } or null

The annotation object being added. (See annotation schema for details.)

annotation_index: integer

The index of the annotation within the content part.

content_index: integer

The index of the content part within the output item.

item_id: string

The unique identifier of the item to which the annotation is being added.

output_index: integer

The index of the output item in the response's output array.

sequence_number: integer

The sequence number of this event.

type: "response.output_text.annotation.added"

The type of the event. Always 'response.output_text.annotation.added'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.queued

Emitted when a response is queued and waiting to be processed.

response: Response { id, access_programs, created_at, 36 more }

The full response object that is queued.

sequence_number: integer

The sequence number for this event.

type: "response.queued"

The type of the event. Always 'response.queued'.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.custom_tool_call_input.delta

Event representing a delta (partial update) to the input of a custom tool call.

delta: string

The incremental input data (delta) for the custom tool call.

item_id: string

Unique identifier for the API item associated with this event.

output_index: integer

The index of the output this delta applies to.

sequence_number: integer

The sequence number of this event.

type: "response.custom_tool_call_input.delta"

The event type identifier.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.custom_tool_call_input.done

Event indicating that input for a custom tool call is complete.

input: string

The complete input data for the custom tool call.

item_id: string

Unique identifier for the API item associated with this event.

output_index: integer

The index of the output this event applies to.

sequence_number: integer

The sequence number of this event.

type: "response.custom_tool_call_input.done"

The event type identifier.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.audio.delta

Emitted when there is a partial audio response.

delta: string

A chunk of Base64 encoded response audio bytes.

sequence_number: integer

A sequence number for this chunk of the stream response.

type: "response.audio.delta"

The type of the event. Always response.audio.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.audio.done

Emitted when the audio response is complete.

sequence_number: integer

The sequence number of the delta.

type: "response.audio.done"

The type of the event. Always response.audio.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.audio.transcript.delta

Emitted when there is a partial transcript of audio.

delta: string

The partial transcript of the audio response.

sequence_number: integer

The sequence number of this event.

type: "response.audio.transcript.delta"

The type of the event. Always response.audio.transcript.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.audio.transcript.done

Emitted when the full audio transcript is completed.

sequence_number: integer

The sequence number of this event.

type: "response.audio.transcript.done"

The type of the event. Always response.audio.transcript.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.compaction.compacting

Emitted when new summary content is sampled for a compaction trigger. Contains no summary content.

item_id: string

The ID of the compaction output item.

output_index: integer

The index of the compaction output item.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.compaction.compacting" (default: "response.compaction.compacting")

The type of the event, always response.compaction.compacting.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.shell_call_command.added

A streaming event that indicated a shell command was added to a tool call.

command: string

The shell command that was added.

command_index: integer

The index of the shell command that was added.

output_index: integer

The index of the output item that was updated.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.shell_call_command.added" (default: "response.shell_call_command.added")

The type of the event, always response.shell_call_command.added.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.shell_call_command.delta

A streaming event that indicated a shell command was incrementally updated.

command_index: integer

The index of the shell command that was updated.

delta: string

The shell command delta that was appended.

output_index: integer

The index of the output item that was updated.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.shell_call_command.delta" (default: "response.shell_call_command.delta")

The type of the event, always response.shell_call_command.delta.

obfuscation: optional string

An obfuscation string that was added to pad the event payload.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.shell_call_command.done

A streaming event that indicated a shell command was completed.

command: string

The final shell command that was emitted.

command_index: integer

The index of the shell command that was completed.

output_index: integer

The index of the output item that was updated.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.shell_call_command.done" (default: "response.shell_call_command.done")

The type of the event, always response.shell_call_command.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.shell_call_output_content.delta

A streaming event that indicated shell call output was incrementally added.

command_index: integer

The index of the shell command that produced output.

delta: object { stderr, stdout }

The stdout/stderr delta that was emitted.

stderr: optional string

The stderr delta that was emitted.

stdout: optional string

The stdout delta that was emitted.

item_id: string

The ID of the output item that was updated.

output_index: integer

The index of the output item that was updated.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.shell_call_output_content.delta" (default: "response.shell_call_output_content.delta")

The type of the event, always response.shell_call_output_content.delta.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.

response.shell_call_output_content.done

A streaming event that indicated shell call output was completed.

command_index: integer

The index of the shell command that produced output.

item_id: string

The ID of the output item that was updated.

output: array of object { outcome, stderr, stdout, created_by }

The output contents emitted for the shell command.

output_index: integer

The index of the output item that was updated.

sequence_number: integer

The sequence number of the event that was emitted.

type: "response.shell_call_output_content.done" (default: "response.shell_call_output_content.done")

The type of the event, always response.shell_call_output_content.done.

stream_id: optional string

The WebSocket lane that emitted this event. This field is present when the originating response.create event supplied a stream_id.