Responses
Cancel a response
Compact conversation
Create a model response
Delete a model response
Get a model response
ModelsExpand Collapse
List[BetaComputerAction]Flattened batched actions for computer_use. Each action includes an
type discriminator and action-specific fields.
Flattened batched actions for computer_use. Each action includes an
type discriminator and action-specific fields.
class BetaComputerTool: …A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
class BetaComputerUsePreviewTool: …A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
class BetaCustomTool: …A custom tool that processes input using a specified format. Learn more about custom tools
A custom tool that processes input using a specified format. Learn more about custom tools
class BetaEasyInputMessage: …A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
class BetaFileSearchTool: …A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
class BetaFunctionTool: …Defines a function in your own code the model can choose to call. Learn more about function calling.
Defines a function in your own code the model can choose to call. Learn more about function calling.
class BetaResponseCompactionItem: …A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class BetaResponseCompactionItemParam: …A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class BetaResponseComputerToolCall: …A tool call to a computer use tool. See the
computer use guide for more information.
A tool call to a computer use tool. See the computer use guide for more information.
class BetaResponseFileSearchToolCall: …The results of a file search tool call. See the
file search guide for more information.
The results of a file search tool call. See the file search guide for more information.
An object specifying the format that the model must output.
Configuring { "type": "json_schema" } enables Structured Outputs,
which ensures the model will match your supplied JSON schema. Learn more in the
Structured Outputs guide.
The default format is { "type": "text" } with no additional options.
Not recommended for gpt-4o and newer models:
Setting to { "type": "json_object" } enables the older JSON mode, which
ensures the message the model generates is valid JSON. Using json_schema
is preferred for models that support it.
An object specifying the format that the model must output.
Configuring { "type": "json_schema" } enables Structured Outputs,
which ensures the model will match your supplied JSON schema. Learn more in the
Structured Outputs guide.
The default format is { "type": "text" } with no additional options.
Not recommended for gpt-4o and newer models:
Setting to { "type": "json_object" } enables the older JSON mode, which
ensures the message the model generates is valid JSON. Using json_schema
is preferred for models that support it.
class BetaResponseFormatTextJSONSchemaConfig: …JSON Schema response format. Used to generate structured JSON responses.
Learn more about Structured Outputs.
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
class BetaResponseFunctionToolCall: …A tool call to run a function. See the
function calling guide for more information.
A tool call to run a function. See the function calling guide for more information.
class BetaResponseFunctionToolCallItem: …A tool call to run a function. See the
function calling guide for more information.
A tool call to run a function. See the function calling guide for more information.
class BetaResponseFunctionWebSearch: …The results of a web search tool call. See the
web search guide for more information.
The results of a web search tool call. See the web search guide for more information.
Literal["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", 5 more]Specify additional output data to include in the model response. Currently supported values are:
web_search_call.results: Include the search results of the web search tool call.
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).
Specify additional output data to include in the model response. Currently supported values are:
web_search_call.results: Include the search results of the web search tool call.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 thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program).
List[BetaResponseInputItem]A list of one or many input items to the model, containing
different content types.
A list of one or many input items to the model, containing different content types.
class BetaResponseInputImage: …An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
class BetaResponseInputImageContent: …An image input to the model. Learn about image inputs
An image input to the model. Learn about image inputs
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
List[BetaResponseInputContent]A list of one or many input items to the model, containing different content
types.
A list of one or many input items to the model, containing different content types.
class BetaResponsePrompt: …Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
class BetaResponseReasoningItem: …A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
class BetaResponseSteerAcceptedEvent: …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.
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.
Union[Literal["response_not_found", "invalid_input", "steering_not_supported", 4 more], str]A machine-readable steering error code. Clients should handle unknown
values because additional codes may be introduced. Known values include:
response_not_found: The target response is not available on this connection.
invalid_input: The event or input failed validation.
steering_not_supported: The model or response execution mode does not support steering.
too_many_pending_steers: Too much steering input is pending for the response.
response_already_completed: The response completed and is no longer accepting steering input.
response_not_active: The response is no longer accepting steering input.
successor_creation_failed: The successor response could not be created.
A machine-readable steering error code. Clients should handle unknown values because additional codes may be introduced. Known values include:
response_not_found: The target response is not available on this connection.invalid_input: The event or input failed validation.steering_not_supported: The model or response execution mode does not support steering.too_many_pending_steers: Too much steering input is pending for the response.response_already_completed: The response completed and is no longer accepting steering input.response_not_active: The response is no longer accepting steering input.successor_creation_failed: The successor response could not be created.
class BetaResponseSteerEvent: …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.
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.
class BetaResponseSteerFailedEvent: …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.
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.
Union[str, List[Union[Dict[str, unknown], Dict[str, unknown]]]]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.
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.
class BetaResponseSteerPendingEvent: …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.
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.
Union[Literal["waiting_for_required_input"], str]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.
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 byrequired_input.
An input stub identifying an outstanding client-owned tool result or
approval decision. Copy the stub and fill the result fields using the
corresponding response.create input schema. Use saved results without
rerunning the tool. The server does not supply results, approval decisions,
or safety acknowledgements in these stubs.
An input stub identifying an outstanding client-owned tool result or
approval decision. Copy the stub and fill the result fields using the
corresponding response.create input schema. Use saved results without
rerunning the tool. The server does not supply results, approval decisions,
or safety acknowledgements in these stubs.
Optional[Literal["auto", "default", "flex", 4 more]]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.
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=fastorservice_tier=priorityparameter for Responses or Chat Completions. The response will showservice_tier=priorityregardless of if you specifyservice_tier=fastorpriorityin 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 showservice_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.
Literal["none", "auto", "required"]Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or
more tools.
required means the model must call one or more tools.
Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or
more tools.
required means the model must call one or more tools.
class BetaToolChoiceTypes: …Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
class BetaWebSearchPreviewTool: …This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
class BetaWebSearchTool: …Search the Internet for sources related to the prompt. Learn more about the
web search tool.
Search the Internet for sources related to the prompt. Learn more about the web search tool.