Responses
Cancel a response
Compact a response
Create a model response
Delete a model response
Get a model response
ModelsExpand Collapse
class BetaComputerTool { type } 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 { display_height, display_width, environment, type } 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 { name, type, allowed_callers, 3 more } 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 { content, role, phase, type } 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 { type, vector_store_ids, filters, 2 more } 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 { name, parameters, strict, 5 more } 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 { id, encrypted_content, type, 2 more } A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class BetaResponseCompactionItemParam { encrypted_content, type, id, agent } A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class BetaResponseComputerToolCall { id, call_id, pending_safety_checks, 5 more } 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.
BetaResponseContent = BetaResponseInputText { text, type, prompt_cache_breakpoint } | BetaResponseInputImage { detail, type, file_id, 2 more } | BetaResponseInputFile { type, detail, file_data, 4 more } | 3 moreMulti-modal input and output contents.
Multi-modal input and output contents.
class BetaResponseFileSearchToolCall { id, queries, status, 3 more } 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.
BetaResponseFormatTextConfig = Text{ type} | BetaResponseFormatTextJSONSchemaConfig { name, schema, type, 2 more } | JSONObject{ type}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 { name, schema, type, 2 more } 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.
BetaResponseFunctionCallOutputItem = BetaResponseInputTextContent { text, type, prompt_cache_breakpoint } | BetaResponseInputImageContent { type, detail, file_id, 2 more } | BetaResponseInputFileContent { type, detail, file_data, 4 more } A piece of message content, such as text, an image, or a file.
A piece of message content, such as text, an image, or a file.
class BetaResponseFunctionToolCall { arguments, call_id, name, 6 more } 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 { id, status, created_by } 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 { id, action, status, 2 more } 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.
BetaResponseIncludable = :"file_search_call.results" | :"web_search_call.results" | :"web_search_call.action.sources" | 5 moreSpecify 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).
BetaResponseInputContent = BetaResponseInputText { text, type, prompt_cache_breakpoint } | BetaResponseInputImage { detail, type, file_id, 2 more } | BetaResponseInputFile { type, detail, file_data, 4 more } A text input to the model.
A text input to the model.
class BetaResponseInputImage { detail, type, file_id, 2 more } An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
class BetaResponseInputImageContent { type, detail, file_id, 2 more } An image input to the model. Learn about image inputs
An image input to the model. Learn about image inputs
BetaResponseInputItem = BetaEasyInputMessage { content, role, phase, type } | Message{ content, role, agent, 2 more} | BetaResponseOutputMessage { id, content, role, 4 more } | 32 moreA 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.
BetaResponseItem = BetaResponseInputMessageItem { id, content, role, 3 more } | BetaResponseOutputMessage { id, content, role, 4 more } | BetaResponseFileSearchToolCall { id, queries, status, 3 more } | 29 moreContent item used to generate a response.
Content item used to generate a response.
BetaResponseOutputItem = BetaResponseOutputMessage { id, content, role, 4 more } | BetaResponseFileSearchToolCall { id, queries, status, 3 more } | BetaResponseFunctionToolCall { arguments, call_id, name, 6 more } | 28 moreAn output message from the model.
An output message from the model.
class BetaResponsePrompt { id, variables, version } Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
class BetaResponseReasoningItem { id, summary, type, 4 more } 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.
BetaResponseStreamEvent = BetaResponseAudioDeltaEvent { delta, sequence_number, type, agent } | BetaResponseAudioDoneEvent { sequence_number, type, agent } | BetaResponseAudioTranscriptDeltaEvent { delta, sequence_number, type, agent } | 55 moreEvent emitted while a response is streamed.
Event emitted while a response is streamed.
BetaResponsesClientEvent = ResponseCreate{ type, background, context_management, 31 more} | BetaResponseInjectEvent { input, response_id, type } Client events accepted by the Responses WebSocket server.
Client events accepted by the Responses WebSocket server.
BetaResponsesServerEvent = BetaResponseAudioDeltaEvent { delta, sequence_number, type, agent } & { stream_id} | BetaResponseAudioDoneEvent { sequence_number, type, agent } & { stream_id} | BetaResponseAudioTranscriptDeltaEvent { delta, sequence_number, type, agent } & { stream_id} | 57 moreServer events emitted by the Responses WebSocket server.
Server events emitted by the Responses WebSocket server.
BetaTool = BetaFunctionTool { name, parameters, strict, 5 more } | BetaFileSearchTool { type, vector_store_ids, filters, 2 more } | BetaComputerTool { type } | 13 moreA tool that can be used to generate a response.
A tool that can be used to generate a response.
BetaToolChoiceOptions = :none | :auto | :requiredControls 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 { type } 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 { type, search_content_types, search_context_size, user_location } 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 { type, external_web_access, filters, 2 more } 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.