Responses
Create a model response
$ openai responses create
post /responses
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
Parameters
-
--background: optional booleanWhether to run the model response in the background. Learn more.
-
--context-management: optional array of object { type, compact_threshold }Context management configuration for this request.
-
--conversation: optional string or ResponseConversationParamThe conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes. -
--include: optional array of ResponseIncludableSpecify 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 thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program).
-
--input: optional string or ResponseInputText, image, or file inputs to the model, used to generate a response.
Learn more:
-
--instructions: optional stringA 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 numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
--max-tool-calls: optional numberThe 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 map[string]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 string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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 }Configuration for running moderation on the input and output of this response.
-
--parallel-tool-calls: optional booleanWhether to allow the model to run tool calls in parallel.
-
--previous-response-id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
--prompt-cache-key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
--prompt-cache-retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
--reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
--safety-identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
--service-tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue 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 booleanWhether to store the generated model response for later retrieval via API.
-
--stream-options: optional object { include_obfuscation }Options for streaming responses. Only set this when you set
stream: true. -
--temperature: optional numberWhat 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_pbut not both. -
--text: optional object { 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 or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
--tool: optional array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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 numberAn 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.
-
--top-p: optional numberAn 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
temperaturebut not both. -
--truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
--user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
Returns
-
response: object { id, created_at, error, 30 more }-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
Example
openai responses create \
--api-key 'My API Key'
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 0,
"truncation": "auto",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": "user-1234"
}
Get a model response
$ openai responses retrieve
get /responses/{response_id}
Retrieves a model response with the given ID.
Parameters
-
--response-id: stringThe ID of the response to retrieve.
-
--include: optional array of ResponseIncludableAdditional fields to include in the response. See the
includeparameter for Response creation above for more information. -
--include-obfuscation: optional booleanWhen true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an
obfuscationfield 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 setinclude_obfuscationto false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. -
--starting-after: optional numberThe sequence number of the event after which to start streaming.
Returns
-
response: object { id, created_at, error, 30 more }-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
Example
openai responses retrieve \
--api-key 'My API Key' \
--response-id resp_677efb5139a88190b512bc3fef8e535d
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 0,
"truncation": "auto",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": "user-1234"
}
Delete a model response
$ openai responses delete
delete /responses/{response_id}
Deletes a model response with the given ID.
Parameters
-
--response-id: stringThe ID of the response to delete.
Example
openai responses delete \
--api-key 'My API Key' \
--response-id resp_677efb5139a88190b512bc3fef8e535d
Cancel a response
$ openai responses cancel
post /responses/{response_id}/cancel
Cancels a model response with the given ID. Only responses created with
the background parameter set to true can be cancelled.
Learn more.
Parameters
-
--response-id: stringThe ID of the response to cancel.
Returns
-
response: object { id, created_at, error, 30 more }-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
Example
openai responses cancel \
--api-key 'My API Key' \
--response-id resp_677efb5139a88190b512bc3fef8e535d
Response
{
"id": "id",
"created_at": 0,
"error": {
"code": "server_error",
"message": "message"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"instructions": "string",
"metadata": {
"foo": "string"
},
"model": "gpt-5.1",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"parallel_tool_calls": true,
"temperature": 1,
"tool_choice": "none",
"tools": [
{
"name": "name",
"parameters": {
"foo": "bar"
},
"strict": true,
"type": "function",
"defer_loading": true,
"description": "description"
}
],
"top_p": 1,
"background": true,
"completed_at": 0,
"conversation": {
"id": "id"
},
"max_output_tokens": 0,
"max_tool_calls": 0,
"moderation": {
"input": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
},
"output": {
"categories": {
"foo": true
},
"category_applied_input_types": {
"foo": [
"text"
]
},
"category_scores": {
"foo": 0
},
"flagged": true,
"model": "model",
"type": "moderation_result"
}
},
"output_text": "output_text",
"previous_response_id": "previous_response_id",
"prompt": {
"id": "id",
"variables": {
"foo": "string"
},
"version": "version"
},
"prompt_cache_key": "prompt-cache-key-1234",
"prompt_cache_retention": "in_memory",
"reasoning": {
"context": "auto",
"effort": "none",
"generate_summary": "auto",
"summary": "auto"
},
"safety_identifier": "safety-identifier-1234",
"service_tier": "auto",
"status": "completed",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"top_logprobs": 0,
"truncation": "auto",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"user": "user-1234"
}
Compact a response
$ openai responses compact
post /responses/compact
Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see Compaction (advanced).
Parameters
-
--model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 89 more or stringModel ID used to generate the response, like
gpt-5oro3. 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. -
--input: optional string or array of ResponseInputItemText, image, or file inputs to the model, used to generate a response
-
--instructions: optional stringA system (or developer) message inserted into the model's context. When used 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. -
--previous-response-id: optional stringThe 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-cache-key: optional stringA key to use when reading from or writing to the prompt cache.
-
--prompt-cache-retention: optional "in_memory" or "24h"How long to retain a prompt cache entry created by this request.
-
--service-tier: optional "auto" or "default" or "flex" or "priority"The service tier to use for this request.
Returns
-
compacted_response: object { id, created_at, object, 2 more }-
id: stringThe unique identifier for the compacted response.
-
created_at: numberUnix timestamp (in seconds) when the compacted conversation was created.
-
object: "response.compaction"The object type. Always
response.compaction. -
output: array of ResponseOutputItemThe compacted list of output items. This is a list of all user messages, followed by a single compaction item.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
usage: object { input_tokens, input_tokens_details, output_tokens, 2 more }Token accounting for the compaction pass, including cached, reasoning, and total tokens.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
Example
openai responses compact \
--api-key 'My API Key' \
--model gpt-5.4
Response
{
"id": "id",
"created_at": 0,
"object": "response.compaction",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message",
"phase": "commentary"
}
],
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}
Domain Types
Apply Patch Tool
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
Compacted Response
-
compacted_response: object { id, created_at, object, 2 more }-
id: stringThe unique identifier for the compacted response.
-
created_at: numberUnix timestamp (in seconds) when the compacted conversation was created.
-
object: "response.compaction"The object type. Always
response.compaction. -
output: array of ResponseOutputItemThe compacted list of output items. This is a list of all user messages, followed by a single compaction item.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
usage: object { input_tokens, input_tokens_details, output_tokens, 2 more }Token accounting for the compaction pass, including cached, reasoning, and total tokens.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
Computer Action
-
computer_action: object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
Computer Action List
-
computer_action_list: array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
Computer Tool
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
Computer Use Preview Tool
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
Container Auto
-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
Container Network Policy Allowlist
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
Container Network Policy Disabled
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
Container Network Policy Domain Secret
-
container_network_policy_domain_secret: object { domain, name, value }-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
Container Reference
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
Custom Tool
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
Easy Input Message
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
File Search Tool
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
Function Shell Tool
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
Function Tool
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
Inline Skill
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
Inline Skill Source
-
inline_skill_source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
Local Environment
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
Local Skill
-
local_skill: object { description, name, path }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
Namespace Tool
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
Response
-
response: object { id, created_at, error, 30 more }-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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 Apply Patch Tool Call
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
Response Apply Patch Tool Call Output
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
Response Audio Delta Event
-
response_audio_delta_event: object { delta, sequence_number, type }Emitted when there is a partial audio response.
-
delta: stringA chunk of Base64 encoded response audio bytes.
-
sequence_number: numberA sequence number for this chunk of the stream response.
-
type: "response.audio.delta"The type of the event. Always
response.audio.delta.
-
Response Audio Done Event
-
response_audio_done_event: object { sequence_number, type }Emitted when the audio response is complete.
-
sequence_number: numberThe sequence number of the delta.
-
type: "response.audio.done"The type of the event. Always
response.audio.done.
-
Response Audio Transcript Delta Event
-
response_audio_transcript_delta_event: object { delta, sequence_number, type }Emitted when there is a partial transcript of audio.
-
delta: stringThe partial transcript of the audio response.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.delta"The type of the event. Always
response.audio.transcript.delta.
-
Response Audio Transcript Done Event
-
response_audio_transcript_done_event: object { sequence_number, type }Emitted when the full audio transcript is completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.done"The type of the event. Always
response.audio.transcript.done.
-
Response Code Interpreter Call Code Delta Event
-
response_code_interpreter_call_code_delta_event: object { delta, item_id, output_index, 2 more }Emitted when a partial code snippet is streamed by the code interpreter.
-
delta: stringThe partial code snippet being streamed by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is being streamed.
-
sequence_number: numberThe 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.
-
Response Code Interpreter Call Code Done Event
-
response_code_interpreter_call_code_done_event: object { code, item_id, output_index, 2 more }Emitted when the code snippet is finalized by the code interpreter.
-
code: stringThe final code snippet output by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is finalized.
-
sequence_number: numberThe 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.
-
Response Code Interpreter Call Completed Event
-
response_code_interpreter_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter call is completed.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is completed.
-
sequence_number: numberThe 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.
-
Response Code Interpreter Call In Progress Event
-
response_code_interpreter_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a code interpreter call is in progress.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is in progress.
-
sequence_number: numberThe 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.
-
Response Code Interpreter Call Interpreting Event
-
response_code_interpreter_call_interpreting_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter is actively interpreting the code snippet.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter is interpreting code.
-
sequence_number: numberThe 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.
-
Response Code Interpreter Tool Call
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
Response Compaction Item
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
Response Compaction Item Param
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
Response Completed Event
-
response_completed_event: object { response, sequence_number, type }Emitted when the model response is complete.
-
response: object { id, created_at, error, 30 more }Properties of the completed response.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.completed"The type of the event. Always
response.completed.
-
Response Computer Tool Call
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
Response Computer Tool Call Output Item
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
Response Computer Tool Call Output Screenshot
-
response_computer_tool_call_output_screenshot: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
Response Container Reference
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
Response Content
-
response_content: ResponseInputText or ResponseInputImage or ResponseInputFile or 3 moreMulti-modal input and output contents.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
ReasoningTextContent: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
Response Content Part Added Event
-
response_content_part_added_event: object { content_index, item_id, output_index, 3 more }Emitted when a new content part is added.
-
content_index: numberThe index of the content part that was added.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that was added.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.added"The type of the event. Always
response.content_part.added.
-
Response Content Part Done Event
-
response_content_part_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a content part is done.
-
content_index: numberThe index of the content part that is done.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that is done.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.done"The type of the event. Always
response.content_part.done.
-
Response Conversation Param
-
response_conversation_param: object { id }The conversation that this response belongs to.
-
id: stringThe unique ID of the conversation.
-
Response Created Event
-
response_created_event: object { response, sequence_number, type }An event that is emitted when a response is created.
-
response: object { id, created_at, error, 30 more }The response that was created.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.created"The type of the event. Always
response.created.
-
Response Custom Tool Call
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
Response Custom Tool Call Input Delta Event
-
response_custom_tool_call_input_delta_event: object { delta, item_id, output_index, 2 more }Event representing a delta (partial update) to the input of a custom tool call.
-
delta: stringThe incremental input data (delta) for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this delta applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.delta"The event type identifier.
-
Response Custom Tool Call Input Done Event
-
response_custom_tool_call_input_done_event: object { input, item_id, output_index, 2 more }Event indicating that input for a custom tool call is complete.
-
input: stringThe complete input data for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this event applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.done"The event type identifier.
-
Response Custom Tool Call Item
-
response_custom_tool_call_item: ResponseCustomToolCallA call to a custom tool created by the model.
-
id: stringThe unique ID of the custom tool call item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
Response Custom Tool Call Output
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
Response Custom Tool Call Output Item
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
Response Error
-
response_error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
Response Error Event
-
response_error_event: object { code, message, param, 2 more }Emitted when an error occurs.
-
code: stringThe error code.
-
message: stringThe error message.
-
param: stringThe error parameter.
-
sequence_number: numberThe sequence number of this event.
-
type: "error"The type of the event. Always
error.
-
Response Failed Event
-
response_failed_event: object { response, sequence_number, type }An event that is emitted when a response fails.
-
response: object { id, created_at, error, 30 more }The response that failed.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.failed"The type of the event. Always
response.failed.
-
Response File Search Call Completed Event
-
response_file_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is completed (results found).
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.completed"The type of the event. Always
response.file_search_call.completed.
-
Response File Search Call In Progress Event
-
response_file_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is initiated.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.in_progress"The type of the event. Always
response.file_search_call.in_progress.
-
Response File Search Call Searching Event
-
response_file_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a file search is currently searching.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is searching.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.searching"The type of the event. Always
response.file_search_call.searching.
-
Response File Search Tool Call
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
Response Format Text Config
-
response_format_text_config: ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
Response Format Text JSON Schema Config
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
Response Function Call Arguments Delta Event
-
response_function_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a partial function-call arguments delta.
-
delta: stringThe function-call arguments delta that is added.
-
item_id: stringThe ID of the output item that the function-call arguments delta is added to.
-
output_index: numberThe index of the output item that the function-call arguments delta is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.delta"The type of the event. Always
response.function_call_arguments.delta.
-
Response Function Call Arguments Done Event
-
response_function_call_arguments_done_event: object { arguments, item_id, name, 3 more }Emitted when function-call arguments are finalized.
-
arguments: stringThe function-call arguments.
-
item_id: stringThe ID of the item.
-
name: stringThe name of the function that was called.
-
output_index: numberThe index of the output item.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.done"
-
Response Function Call Output Item
-
response_function_call_output_item: ResponseInputTextContent or ResponseInputImageContent or ResponseInputFileContentA piece of message content, such as text, an image, or a file.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
Response Function Call Output Item List
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
Response Function Shell Call Output Content
-
response_function_shell_call_output_content: object { outcome, stderr, stdout }Captured stdout and stderr for a portion of a shell tool call output.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
Response Function Shell Tool Call
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
Response Function Shell Tool Call Output
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
Response Function Tool Call
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
Response Function Tool Call Item
-
response_function_tool_call_item: ResponseFunctionToolCallA tool call to run a function. See the function calling guide for more information.
-
id: stringThe unique ID of the function tool call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
Response Function Tool Call Output Item
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
Response Function Web Search
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
Response Image Gen Call Completed Event
-
response_image_gen_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call has completed and the final image is available.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.image_generation_call.completed"The type of the event. Always 'response.image_generation_call.completed'.
-
Response Image Gen Call Generating Event
-
response_image_gen_call_generating_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is actively generating an image (intermediate state).
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
Response Image Gen Call In Progress Event
-
response_image_gen_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is in progress.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
Response Image Gen Call Partial Image Event
-
response_image_gen_call_partial_image_event: object { item_id, output_index, partial_image_b64, 3 more }Emitted when a partial image is available during image generation streaming.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
partial_image_b64: stringBase64-encoded partial image data, suitable for rendering as an image.
-
partial_image_index: number0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
sequence_number: numberThe 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'.
-
Response In Progress Event
-
response_in_progress_event: object { response, sequence_number, type }Emitted when the response is in progress.
-
response: object { id, created_at, error, 30 more }The response that is in progress.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.in_progress"The type of the event. Always
response.in_progress.
-
Response Includable
-
response_includable: "file_search_call.results" or "web_search_call.results" or "web_search_call.action.sources" or 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 thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program). -
"file_search_call.results" -
"web_search_call.results" -
"web_search_call.action.sources" -
"message.input_image.image_url" -
"computer_call_output.output.image_url" -
"code_interpreter_call.outputs" -
"reasoning.encrypted_content" -
"message.output_text.logprobs"
-
Response Incomplete Event
-
response_incomplete_event: object { response, sequence_number, type }An event that is emitted when a response finishes as incomplete.
-
response: object { id, created_at, error, 30 more }The response that was incomplete.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.incomplete"The type of the event. Always
response.incomplete.
-
Response Input
-
response_input: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
Response Input Audio
-
response_input_audio: object { input_audio, type }An audio input to the model.
-
input_audio: object { data, format }-
data: stringBase64-encoded audio data.
-
format: "mp3" or "wav"The format of the audio data. Currently supported formats are
mp3andwav.-
"mp3" -
"wav"
-
-
-
type: "input_audio"The type of the input item. Always
input_audio.
-
Response Input Content
-
response_input_content: ResponseInputText or ResponseInputImage or ResponseInputFileA text input to the model.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
Response Input File
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
Response Input File Content
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
Response Input Image
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
Response Input Image Content
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
Response Input Item
-
response_input_item: EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 27 moreA message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
Response Input Message Content List
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
Response Input Message Item
-
response_input_message_item: object { id, content, role, 2 more }-
id: stringThe unique ID of the message input.
-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
type: "message"The type of the message input. Always set to
message. -
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
Response Input Text
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
Response Input Text Content
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
Response Item
-
response_item: ResponseInputMessageItem or ResponseOutputMessage or ResponseFileSearchToolCall or 24 moreContent item used to generate a response.
-
response_input_message_item: object { id, content, role, 2 more }-
id: stringThe unique ID of the message input.
-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
type: "message"The type of the message input. Always set to
message. -
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call_item: ResponseFunctionToolCallA tool call to run a function. See the function calling guide for more information.
-
id: stringThe unique ID of the function tool call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_item: ResponseCustomToolCallA call to a custom tool created by the model.
-
id: stringThe unique ID of the custom tool call item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
Response Local Environment
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
Response Mcp Call Arguments Delta Event
-
response_mcp_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
delta: stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.delta"The type of the event. Always 'response.mcp_call_arguments.delta'.
-
Response Mcp Call Arguments Done Event
-
response_mcp_call_arguments_done_event: object { arguments, item_id, output_index, 2 more }Emitted when the arguments for an MCP tool call are finalized.
-
arguments: stringA JSON string containing the finalized arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.done"The type of the event. Always 'response.mcp_call_arguments.done'.
-
Response Mcp Call Completed Event
-
response_mcp_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has completed successfully.
-
item_id: stringThe ID of the MCP tool call item that completed.
-
output_index: numberThe index of the output item that completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.completed"The type of the event. Always 'response.mcp_call.completed'.
-
Response Mcp Call Failed Event
-
response_mcp_call_failed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.failed"The type of the event. Always 'response.mcp_call.failed'.
-
Response Mcp Call In Progress Event
-
response_mcp_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call is in progress.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.in_progress"The type of the event. Always 'response.mcp_call.in_progress'.
-
Response Mcp List Tools Completed Event
-
response_mcp_list_tools_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the list of available MCP tools has been successfully retrieved.
-
item_id: stringThe ID of the MCP tool call item that produced this output.
-
output_index: numberThe index of the output item that was processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.completed"The type of the event. Always 'response.mcp_list_tools.completed'.
-
Response Mcp List Tools Failed Event
-
response_mcp_list_tools_failed_event: object { item_id, output_index, sequence_number, type }Emitted when the attempt to list available MCP tools has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.failed"The type of the event. Always 'response.mcp_list_tools.failed'.
-
Response Mcp List Tools In Progress Event
-
response_mcp_list_tools_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when the system is in the process of retrieving the list of available MCP tools.
-
item_id: stringThe ID of the MCP tool call item that is being processed.
-
output_index: numberThe index of the output item that is being processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.in_progress"The type of the event. Always 'response.mcp_list_tools.in_progress'.
-
Response Output Audio
-
response_output_audio: object { data, transcript, type }An audio output from the model.
-
data: stringBase64-encoded audio data from the model.
-
transcript: stringThe transcript of the audio data from the model.
-
type: "output_audio"The type of the output audio. Always
output_audio.
-
Response Output Item
-
response_output_item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreAn output message from the model.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
Response Output Item Added Event
-
response_output_item_added_event: object { item, output_index, sequence_number, type }Emitted when a new output item is added.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was added.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
output_index: numberThe index of the output item that was added.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.added"The type of the event. Always
response.output_item.added.
-
Response Output Item Done Event
-
response_output_item_done_event: object { item, output_index, sequence_number, type }Emitted when an output item is marked done.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was marked done.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
output_index: numberThe index of the output item that was marked done.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.done"The type of the event. Always
response.output_item.done.
-
Response Output Message
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
Response Output Refusal
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
Response Output Text
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
Response Output Text Annotation Added Event
-
response_output_text_annotation_added_event: object { annotation, annotation_index, content_index, 4 more }Emitted when an annotation is added to output text content.
-
annotation: unknownThe annotation object being added. (See annotation schema for details.)
-
annotation_index: numberThe index of the annotation within the content part.
-
content_index: numberThe index of the content part within the output item.
-
item_id: stringThe unique identifier of the item to which the annotation is being added.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_text.annotation.added"The type of the event. Always 'response.output_text.annotation.added'.
-
Response Prompt
-
response_prompt: object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
version: optional stringOptional version of the prompt template.
-
Response Queued Event
-
response_queued_event: object { response, sequence_number, type }Emitted when a response is queued and waiting to be processed.
-
response: object { id, created_at, error, 30 more }The full response object that is queued.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.queued"The type of the event. Always 'response.queued'.
-
Response Reasoning Item
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
Response Reasoning Summary Part Added Event
-
response_reasoning_summary_part_added_event: object { item_id, output_index, part, 3 more }Emitted when a new reasoning summary part is added.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The summary part that was added.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
Response Reasoning Summary Part Done Event
-
response_reasoning_summary_part_done_event: object { item_id, output_index, part, 3 more }Emitted when a reasoning summary part is completed.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The completed summary part.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
Response Reasoning Summary Text Delta Event
-
response_reasoning_summary_text_delta_event: object { delta, item_id, output_index, 3 more }Emitted when a delta is added to a reasoning summary text.
-
delta: stringThe text delta that was added to the summary.
-
item_id: stringThe ID of the item this summary text delta is associated with.
-
output_index: numberThe index of the output item this summary text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
Response Reasoning Summary Text Done Event
-
response_reasoning_summary_text_done_event: object { item_id, output_index, sequence_number, 3 more }Emitted when a reasoning summary text is completed.
-
item_id: stringThe ID of the item this summary text is associated with.
-
output_index: numberThe index of the output item this summary text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe index of the summary part within the reasoning summary.
-
text: stringThe full text of the completed reasoning summary.
-
type: "response.reasoning_summary_text.done"The type of the event. Always
response.reasoning_summary_text.done.
-
Response Reasoning Text Delta Event
-
response_reasoning_text_delta_event: object { content_index, delta, item_id, 3 more }Emitted when a delta is added to a reasoning text.
-
content_index: numberThe index of the reasoning content part this delta is associated with.
-
delta: stringThe text delta that was added to the reasoning content.
-
item_id: stringThe ID of the item this reasoning text delta is associated with.
-
output_index: numberThe index of the output item this reasoning text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.reasoning_text.delta"The type of the event. Always
response.reasoning_text.delta.
-
Response Reasoning Text Done Event
-
response_reasoning_text_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a reasoning text is completed.
-
content_index: numberThe index of the reasoning content part.
-
item_id: stringThe ID of the item this reasoning text is associated with.
-
output_index: numberThe index of the output item this reasoning text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
text: stringThe full text of the completed reasoning content.
-
type: "response.reasoning_text.done"The type of the event. Always
response.reasoning_text.done.
-
Response Refusal Delta Event
-
response_refusal_delta_event: object { content_index, delta, item_id, 3 more }Emitted when there is a partial refusal text.
-
content_index: numberThe index of the content part that the refusal text is added to.
-
delta: stringThe refusal text that is added.
-
item_id: stringThe ID of the output item that the refusal text is added to.
-
output_index: numberThe index of the output item that the refusal text is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.delta"The type of the event. Always
response.refusal.delta.
-
Response Refusal Done Event
-
response_refusal_done_event: object { content_index, item_id, output_index, 3 more }Emitted when refusal text is finalized.
-
content_index: numberThe index of the content part that the refusal text is finalized.
-
item_id: stringThe ID of the output item that the refusal text is finalized.
-
output_index: numberThe index of the output item that the refusal text is finalized.
-
refusal: stringThe refusal text that is finalized.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.done"The type of the event. Always
response.refusal.done.
-
Response Status
-
response_status: "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
Response Stream Event
-
response_stream_event: ResponseAudioDeltaEvent or ResponseAudioDoneEvent or ResponseAudioTranscriptDeltaEvent or 50 moreEmitted when there is a partial audio response.
-
response_audio_delta_event: object { delta, sequence_number, type }Emitted when there is a partial audio response.
-
delta: stringA chunk of Base64 encoded response audio bytes.
-
sequence_number: numberA sequence number for this chunk of the stream response.
-
type: "response.audio.delta"The type of the event. Always
response.audio.delta.
-
-
response_audio_done_event: object { sequence_number, type }Emitted when the audio response is complete.
-
sequence_number: numberThe sequence number of the delta.
-
type: "response.audio.done"The type of the event. Always
response.audio.done.
-
-
response_audio_transcript_delta_event: object { delta, sequence_number, type }Emitted when there is a partial transcript of audio.
-
delta: stringThe partial transcript of the audio response.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.delta"The type of the event. Always
response.audio.transcript.delta.
-
-
response_audio_transcript_done_event: object { sequence_number, type }Emitted when the full audio transcript is completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.done"The type of the event. Always
response.audio.transcript.done.
-
-
response_code_interpreter_call_code_delta_event: object { delta, item_id, output_index, 2 more }Emitted when a partial code snippet is streamed by the code interpreter.
-
delta: stringThe partial code snippet being streamed by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is being streamed.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_code_done_event: object { code, item_id, output_index, 2 more }Emitted when the code snippet is finalized by the code interpreter.
-
code: stringThe final code snippet output by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is finalized.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter call is completed.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is completed.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a code interpreter call is in progress.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is in progress.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_interpreting_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter is actively interpreting the code snippet.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter is interpreting code.
-
sequence_number: numberThe 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.
-
-
response_completed_event: object { response, sequence_number, type }Emitted when the model response is complete.
-
response: object { id, created_at, error, 30 more }Properties of the completed response.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.completed"The type of the event. Always
response.completed.
-
-
response_content_part_added_event: object { content_index, item_id, output_index, 3 more }Emitted when a new content part is added.
-
content_index: numberThe index of the content part that was added.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that was added.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.added"The type of the event. Always
response.content_part.added.
-
-
response_content_part_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a content part is done.
-
content_index: numberThe index of the content part that is done.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that is done.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.done"The type of the event. Always
response.content_part.done.
-
-
response_created_event: object { response, sequence_number, type }An event that is emitted when a response is created.
-
response: object { id, created_at, error, 30 more }The response that was created.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.created"The type of the event. Always
response.created.
-
-
response_error_event: object { code, message, param, 2 more }Emitted when an error occurs.
-
code: stringThe error code.
-
message: stringThe error message.
-
param: stringThe error parameter.
-
sequence_number: numberThe sequence number of this event.
-
type: "error"The type of the event. Always
error.
-
-
response_file_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is completed (results found).
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.completed"The type of the event. Always
response.file_search_call.completed.
-
-
response_file_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is initiated.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.in_progress"The type of the event. Always
response.file_search_call.in_progress.
-
-
response_file_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a file search is currently searching.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is searching.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.searching"The type of the event. Always
response.file_search_call.searching.
-
-
response_function_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a partial function-call arguments delta.
-
delta: stringThe function-call arguments delta that is added.
-
item_id: stringThe ID of the output item that the function-call arguments delta is added to.
-
output_index: numberThe index of the output item that the function-call arguments delta is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.delta"The type of the event. Always
response.function_call_arguments.delta.
-
-
response_function_call_arguments_done_event: object { arguments, item_id, name, 3 more }Emitted when function-call arguments are finalized.
-
arguments: stringThe function-call arguments.
-
item_id: stringThe ID of the item.
-
name: stringThe name of the function that was called.
-
output_index: numberThe index of the output item.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.done"
-
-
response_in_progress_event: object { response, sequence_number, type }Emitted when the response is in progress.
-
response: object { id, created_at, error, 30 more }The response that is in progress.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.in_progress"The type of the event. Always
response.in_progress.
-
-
response_failed_event: object { response, sequence_number, type }An event that is emitted when a response fails.
-
response: object { id, created_at, error, 30 more }The response that failed.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.failed"The type of the event. Always
response.failed.
-
-
response_incomplete_event: object { response, sequence_number, type }An event that is emitted when a response finishes as incomplete.
-
response: object { id, created_at, error, 30 more }The response that was incomplete.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.incomplete"The type of the event. Always
response.incomplete.
-
-
response_output_item_added_event: object { item, output_index, sequence_number, type }Emitted when a new output item is added.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was added.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more } -
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more } -
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
response_tool_search_call: object { id, arguments, call_id, 4 more } -
response_tool_search_output_item: object { id, call_id, execution, 4 more } -
additional_tools: object { id, role, tools, type } -
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI. -
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
-
output_index: numberThe index of the output item that was added.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.added"The type of the event. Always
response.output_item.added.
-
-
response_output_item_done_event: object { item, output_index, sequence_number, type }Emitted when an output item is marked done.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was marked done.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more } -
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more } -
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
response_tool_search_call: object { id, arguments, call_id, 4 more } -
response_tool_search_output_item: object { id, call_id, execution, 4 more } -
additional_tools: object { id, role, tools, type } -
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI. -
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
-
output_index: numberThe index of the output item that was marked done.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.done"The type of the event. Always
response.output_item.done.
-
-
response_reasoning_summary_part_added_event: object { item_id, output_index, part, 3 more }Emitted when a new reasoning summary part is added.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The summary part that was added.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_part_done_event: object { item_id, output_index, part, 3 more }Emitted when a reasoning summary part is completed.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The completed summary part.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_text_delta_event: object { delta, item_id, output_index, 3 more }Emitted when a delta is added to a reasoning summary text.
-
delta: stringThe text delta that was added to the summary.
-
item_id: stringThe ID of the item this summary text delta is associated with.
-
output_index: numberThe index of the output item this summary text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_text_done_event: object { item_id, output_index, sequence_number, 3 more }Emitted when a reasoning summary text is completed.
-
item_id: stringThe ID of the item this summary text is associated with.
-
output_index: numberThe index of the output item this summary text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe index of the summary part within the reasoning summary.
-
text: stringThe full text of the completed reasoning summary.
-
type: "response.reasoning_summary_text.done"The type of the event. Always
response.reasoning_summary_text.done.
-
-
response_reasoning_text_delta_event: object { content_index, delta, item_id, 3 more }Emitted when a delta is added to a reasoning text.
-
content_index: numberThe index of the reasoning content part this delta is associated with.
-
delta: stringThe text delta that was added to the reasoning content.
-
item_id: stringThe ID of the item this reasoning text delta is associated with.
-
output_index: numberThe index of the output item this reasoning text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.reasoning_text.delta"The type of the event. Always
response.reasoning_text.delta.
-
-
response_reasoning_text_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a reasoning text is completed.
-
content_index: numberThe index of the reasoning content part.
-
item_id: stringThe ID of the item this reasoning text is associated with.
-
output_index: numberThe index of the output item this reasoning text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
text: stringThe full text of the completed reasoning content.
-
type: "response.reasoning_text.done"The type of the event. Always
response.reasoning_text.done.
-
-
response_refusal_delta_event: object { content_index, delta, item_id, 3 more }Emitted when there is a partial refusal text.
-
content_index: numberThe index of the content part that the refusal text is added to.
-
delta: stringThe refusal text that is added.
-
item_id: stringThe ID of the output item that the refusal text is added to.
-
output_index: numberThe index of the output item that the refusal text is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.delta"The type of the event. Always
response.refusal.delta.
-
-
response_refusal_done_event: object { content_index, item_id, output_index, 3 more }Emitted when refusal text is finalized.
-
content_index: numberThe index of the content part that the refusal text is finalized.
-
item_id: stringThe ID of the output item that the refusal text is finalized.
-
output_index: numberThe index of the output item that the refusal text is finalized.
-
refusal: stringThe refusal text that is finalized.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.done"The type of the event. Always
response.refusal.done.
-
-
response_text_delta_event: object { content_index, delta, item_id, 4 more }Emitted when there is an additional text delta.
-
content_index: numberThe index of the content part that the text delta was added to.
-
delta: stringThe text delta that was added.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text delta was added to.
-
sequence_number: numberThe sequence number for this event.
-
type: "response.output_text.delta"The type of the event. Always
response.output_text.delta.
-
-
response_text_done_event: object { content_index, item_id, logprobs, 4 more }Emitted when text content is finalized.
-
content_index: numberThe index of the content part that the text content is finalized.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text content is finalized.
-
sequence_number: numberThe sequence number for this event.
-
text: stringThe text content that is finalized.
-
type: "response.output_text.done"The type of the event. Always
response.output_text.done.
-
-
response_web_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is completed.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_web_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is initiated.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_web_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is executing.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_image_gen_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call has completed and the final image is available.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.image_generation_call.completed"The type of the event. Always 'response.image_generation_call.completed'.
-
-
response_image_gen_call_generating_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is actively generating an image (intermediate state).
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
-
response_image_gen_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is in progress.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
-
response_image_gen_call_partial_image_event: object { item_id, output_index, partial_image_b64, 3 more }Emitted when a partial image is available during image generation streaming.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
partial_image_b64: stringBase64-encoded partial image data, suitable for rendering as an image.
-
partial_image_index: number0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
sequence_number: numberThe 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'.
-
-
response_mcp_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
delta: stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.delta"The type of the event. Always 'response.mcp_call_arguments.delta'.
-
-
response_mcp_call_arguments_done_event: object { arguments, item_id, output_index, 2 more }Emitted when the arguments for an MCP tool call are finalized.
-
arguments: stringA JSON string containing the finalized arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.done"The type of the event. Always 'response.mcp_call_arguments.done'.
-
-
response_mcp_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has completed successfully.
-
item_id: stringThe ID of the MCP tool call item that completed.
-
output_index: numberThe index of the output item that completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.completed"The type of the event. Always 'response.mcp_call.completed'.
-
-
response_mcp_call_failed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.failed"The type of the event. Always 'response.mcp_call.failed'.
-
-
response_mcp_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call is in progress.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.in_progress"The type of the event. Always 'response.mcp_call.in_progress'.
-
-
response_mcp_list_tools_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the list of available MCP tools has been successfully retrieved.
-
item_id: stringThe ID of the MCP tool call item that produced this output.
-
output_index: numberThe index of the output item that was processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.completed"The type of the event. Always 'response.mcp_list_tools.completed'.
-
-
response_mcp_list_tools_failed_event: object { item_id, output_index, sequence_number, type }Emitted when the attempt to list available MCP tools has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.failed"The type of the event. Always 'response.mcp_list_tools.failed'.
-
-
response_mcp_list_tools_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when the system is in the process of retrieving the list of available MCP tools.
-
item_id: stringThe ID of the MCP tool call item that is being processed.
-
output_index: numberThe index of the output item that is being processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.in_progress"The type of the event. Always 'response.mcp_list_tools.in_progress'.
-
-
response_output_text_annotation_added_event: object { annotation, annotation_index, content_index, 4 more }Emitted when an annotation is added to output text content.
-
annotation: unknownThe annotation object being added. (See annotation schema for details.)
-
annotation_index: numberThe index of the annotation within the content part.
-
content_index: numberThe index of the content part within the output item.
-
item_id: stringThe unique identifier of the item to which the annotation is being added.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_text.annotation.added"The type of the event. Always 'response.output_text.annotation.added'.
-
-
response_queued_event: object { response, sequence_number, type }Emitted when a response is queued and waiting to be processed.
-
response: object { id, created_at, error, 30 more }The full response object that is queued.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.queued"The type of the event. Always 'response.queued'.
-
-
response_custom_tool_call_input_delta_event: object { delta, item_id, output_index, 2 more }Event representing a delta (partial update) to the input of a custom tool call.
-
delta: stringThe incremental input data (delta) for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this delta applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.delta"The event type identifier.
-
-
response_custom_tool_call_input_done_event: object { input, item_id, output_index, 2 more }Event indicating that input for a custom tool call is complete.
-
input: stringThe complete input data for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this event applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.done"The event type identifier.
-
-
Response Text Config
-
response_text_config: object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
Response Text Delta Event
-
response_text_delta_event: object { content_index, delta, item_id, 4 more }Emitted when there is an additional text delta.
-
content_index: numberThe index of the content part that the text delta was added to.
-
delta: stringThe text delta that was added.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text delta was added to.
-
sequence_number: numberThe sequence number for this event.
-
type: "response.output_text.delta"The type of the event. Always
response.output_text.delta.
-
Response Text Done Event
-
response_text_done_event: object { content_index, item_id, logprobs, 4 more }Emitted when text content is finalized.
-
content_index: numberThe index of the content part that the text content is finalized.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text content is finalized.
-
sequence_number: numberThe sequence number for this event.
-
text: stringThe text content that is finalized.
-
type: "response.output_text.done"The type of the event. Always
response.output_text.done.
-
Response Tool Search Call
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
Response Tool Search Output Item
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
Response Tool Search Output Item Param
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
Response Usage
-
response_usage: object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
Response Web Search Call Completed Event
-
response_web_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is completed.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
Response Web Search Call In Progress Event
-
response_web_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is initiated.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
Response Web Search Call Searching Event
-
response_web_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is executing.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
Responses Client Event
-
responses_client_event: object { type, background, context_management, 28 more }-
type: "response.create"The type of the client event. Always
response.create. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
context_management: optional array of object { type, compact_threshold }Context management configuration for this request.
-
type: stringThe context management entry type. Currently only 'compaction' is supported.
-
compact_threshold: optional numberToken threshold at which compaction should be triggered for this entry.
-
-
conversation: optional string or ResponseConversationParamThe conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.-
Conversation ID: stringThe unique ID of the conversation.
-
response_conversation_param: object { id }The conversation that this response belongs to.
-
id: stringThe unique ID of the conversation.
-
-
-
include: optional array of ResponseIncludableSpecify 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 thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program). -
"file_search_call.results" -
"web_search_call.results" -
"web_search_call.action.sources" -
"message.input_image.image_url" -
"computer_call_output.output.image_url" -
"code_interpreter_call.outputs" -
"reasoning.encrypted_content" -
"message.output_text.logprobs"
-
-
input: optional string or ResponseInputText, image, or file inputs to the model, used to generate a response.
Learn more:
-
Text input: stringA text input to the model, equivalent to a text input with the
userrole. -
response_input: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
instructions: optional stringA 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 numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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 map[string]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 string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
moderation: optional object { model }Configuration for running moderation on the input and output of this response.
-
model: stringThe moderation model to use for moderated completions, e.g. 'omni-moderation-latest'.
-
-
parallel_tool_calls: optional booleanWhether to allow the model to run tool calls in parallel.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
store: optional booleanWhether to store the generated model response for later retrieval via API.
-
stream: optional booleanIf 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_options: optional object { include_obfuscation }Options for streaming responses. Only set this when you set
stream: true.-
include_obfuscation: optional booleanWhen true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an
obfuscationfield 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 setinclude_obfuscationto false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.
-
-
temperature: optional numberWhat 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_pbut not both. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
tool_choice: optional ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: optional array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_logprobs: optional numberAn 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.
-
top_p: optional numberAn 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
temperaturebut not both. -
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
Responses Server Event
-
responses_server_event: ResponseAudioDeltaEvent or ResponseAudioDoneEvent or ResponseAudioTranscriptDeltaEvent or 50 moreServer events emitted by the Responses WebSocket server.
-
response_audio_delta_event: object { delta, sequence_number, type }Emitted when there is a partial audio response.
-
delta: stringA chunk of Base64 encoded response audio bytes.
-
sequence_number: numberA sequence number for this chunk of the stream response.
-
type: "response.audio.delta"The type of the event. Always
response.audio.delta.
-
-
response_audio_done_event: object { sequence_number, type }Emitted when the audio response is complete.
-
sequence_number: numberThe sequence number of the delta.
-
type: "response.audio.done"The type of the event. Always
response.audio.done.
-
-
response_audio_transcript_delta_event: object { delta, sequence_number, type }Emitted when there is a partial transcript of audio.
-
delta: stringThe partial transcript of the audio response.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.delta"The type of the event. Always
response.audio.transcript.delta.
-
-
response_audio_transcript_done_event: object { sequence_number, type }Emitted when the full audio transcript is completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.audio.transcript.done"The type of the event. Always
response.audio.transcript.done.
-
-
response_code_interpreter_call_code_delta_event: object { delta, item_id, output_index, 2 more }Emitted when a partial code snippet is streamed by the code interpreter.
-
delta: stringThe partial code snippet being streamed by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is being streamed.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_code_done_event: object { code, item_id, output_index, 2 more }Emitted when the code snippet is finalized by the code interpreter.
-
code: stringThe final code snippet output by the code interpreter.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code is finalized.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter call is completed.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is completed.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a code interpreter call is in progress.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter call is in progress.
-
sequence_number: numberThe 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.
-
-
response_code_interpreter_call_interpreting_event: object { item_id, output_index, sequence_number, type }Emitted when the code interpreter is actively interpreting the code snippet.
-
item_id: stringThe unique identifier of the code interpreter tool call item.
-
output_index: numberThe index of the output item in the response for which the code interpreter is interpreting code.
-
sequence_number: numberThe 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.
-
-
response_completed_event: object { response, sequence_number, type }Emitted when the model response is complete.
-
response: object { id, created_at, error, 30 more }Properties of the completed response.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 moreThe error code for the response.
-
"server_error" -
"rate_limit_exceeded" -
"invalid_prompt" -
"vector_store_timeout" -
"invalid_image" -
"invalid_image_format" -
"invalid_base64_image" -
"invalid_image_url" -
"image_too_large" -
"image_too_small" -
"image_parse_error" -
"image_content_policy_violation" -
"invalid_image_mode" -
"image_file_too_large" -
"unsupported_image_media_type" -
"empty_image_file" -
"failed_to_download_image" -
"image_file_not_found"
-
-
message: stringA human-readable description of the error.
-
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
reason: optional "max_output_tokens" or "content_filter"The reason why the response is incomplete.
-
"max_output_tokens" -
"content_filter"
-
-
-
instructions: string or array of ResponseInputItemA 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.-
union_member_0: stringA text input to the model, equivalent to a text input with the
developerrole. -
Input item list: array of ResponseInputItemA list of one or many input items to the model, containing different content types.
-
easy_input_message: object { content, role, phase, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole. Messages with theassistantrole are presumed to have been generated by the model in previous interactions.-
content: string or ResponseInputMessageContentListText, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
-
Text input: stringA text input to the model.
-
response_input_message_content_list: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
role: "user" or "assistant" or "system" or "developer"The role of the message input. One of
user,assistant,system, ordeveloper.-
"user" -
"assistant" -
"system" -
"developer"
-
-
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
type: optional "message"The type of the message input. Always
message."message"
-
-
message: object { content, role, status, type }A message input to the model with a role indicating instruction following hierarchy. Instructions given with the
developerorsystemrole take precedence over instructions given with theuserrole.-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: optional "message"The type of the message input. Always set to
message."message"
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
computer_call_output: object { call_id, output, type, 3 more }The output of a computer tool call.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
id: optional stringThe ID of the computer tool call output.
-
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
function_call_output: object { call_id, output, type, 2 more }The output of a function tool call.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or ResponseFunctionCallOutputItemListText, image, or file output of the function tool call.
-
union_member_0: stringA JSON string of the output of the function tool call.
-
response_function_call_output_item_list: array of ResponseFunctionCallOutputItemAn array of content outputs (text, image, file) for the function tool call.
-
response_input_text_content: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image_content: object { type, detail, file_id, image_url }An image input to the model. Learn about image inputs
-
type: "input_image"The type of the input item. Always
input_image. -
detail: optional "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file_content: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe base64-encoded data of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
id: optional stringThe unique ID of the function tool call output. Populated when this item is returned via API.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
tool_search_call: object { arguments, type, id, 3 more }-
arguments: unknownThe arguments supplied to the tool search call.
-
type: "tool_search_call"The item type. Always
tool_search_call. -
id: optional stringThe unique ID of this tool search call.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_tool_search_output_item_param: object { tools, type, id, 3 more }-
tools: array of ToolThe loaded tool definitions returned by the tool search output.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The item type. Always
tool_search_output. -
id: optional stringThe unique ID of this tool search output.
-
call_id: optional stringThe unique ID of the tool search call generated by the model.
-
execution: optional "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the tool search output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
additional_tools: object { role, tools, type, id }-
role: "developer"The role that provided the additional tools. Only
developeris supported. -
tools: array of ToolA list of additional tools made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The item type. Always
additional_tools. -
id: optional stringThe unique ID of this additional tools item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item_param: object { encrypted_content, type, id }A compaction item generated by the
v1/responses/compactAPI.-
encrypted_content: stringThe encrypted content of the compaction summary.
-
type: "compaction"The type of the item. Always
compaction. -
id: optional stringThe ID of the compaction item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call: object { action, call_id, type, 3 more }A tool representing a request to execute one or more shell commands.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of stringOrdered shell commands for the execution environment to run.
-
max_output_length: optional numberMaximum number of UTF-8 characters to capture from combined stdout and stderr output.
-
timeout_ms: optional numberMaximum wall-clock time in milliseconds to allow the shell commands to run.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
type: "shell_call"The type of the item. Always
shell_call. -
id: optional stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
environment: optional LocalEnvironment or ContainerReferenceThe environment to execute the shell commands in.
-
local_environment: object { type, skills } -
container_reference: object { container_id, type }
-
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
shell_call_output: object { call_id, output, type, 3 more }The streamed output items emitted by a shell tool call.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
output: array of ResponseFunctionShellCallOutputContentCaptured chunks of stdout and stderr output, along with their associated outcomes.
-
outcome: object { type } or object { exit_code, type }The exit or timeout outcome associated with this shell call.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberThe exit code returned by the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringCaptured stderr output for the shell call.
-
stdout: stringCaptured stdout output for the shell call.
-
-
type: "shell_call_output"The type of the item. Always
shell_call_output. -
id: optional stringThe unique ID of the shell tool call output. Populated when this item is returned via API.
-
max_output_length: optional numberThe maximum number of UTF-8 characters captured for this shell call's combined output.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the shell call output.
-
"in_progress" -
"completed" -
"incomplete"
-
-
-
apply_patch_call: object { call_id, operation, status, 2 more }A tool call representing a request to create, delete, or update files using diff patches.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }The specific create, delete, or update instruction for the apply_patch tool call.
-
create_file: object { diff, path, type }Instruction for creating a new file via the apply_patch tool.
-
diff: stringUnified diff content to apply when creating the file.
-
path: stringPath of the file to create relative to the workspace root.
-
type: "create_file"The operation type. Always
create_file.
-
-
delete_file: object { path, type }Instruction for deleting an existing file via the apply_patch tool.
-
path: stringPath of the file to delete relative to the workspace root.
-
type: "delete_file"The operation type. Always
delete_file.
-
-
update_file: object { diff, path, type }Instruction for updating an existing file via the apply_patch tool.
-
diff: stringUnified diff content to apply to the existing file.
-
path: stringPath of the file to update relative to the workspace root.
-
type: "update_file"The operation type. Always
update_file.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
id: optional stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
-
apply_patch_call_output: object { call_id, status, type, 2 more }The streamed output emitted by an apply patch tool call.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
id: optional stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
output: optional stringOptional human-readable log text from the apply patch tool (e.g., patch results or errors).
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { approval_request_id, approve, type, 2 more }A response to an MCP approval request.
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
id: optional stringThe unique ID of the approval response
-
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_output: object { call_id, output, type, id }The output of a custom tool call from your code, being sent back to the model.
-
call_id: stringThe call ID, used to map this custom tool call output to a custom tool call.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the custom tool call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the custom tool call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the custom tool call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
type: "custom_tool_call_output"The type of the custom tool call output. Always
custom_tool_call_output. -
id: optional stringThe unique ID of the custom tool call output in the OpenAI platform.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
compaction_trigger: object { type }Compacts the current context. Must be the final input item.
-
item_reference: object { id, type }An internal identifier for an item to reference.
-
id: stringThe ID of the item to reference.
-
type: optional "item_reference"The type of item to reference. Always
item_reference."item_reference"
-
-
-
-
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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.-
union_member_0: string -
chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more-
"gpt-5.4" -
"gpt-5.4-mini" -
"gpt-5.4-nano" -
"gpt-5.4-mini-2026-03-17" -
"gpt-5.4-nano-2026-03-17" -
"gpt-5.3-chat-latest" -
"gpt-5.2" -
"gpt-5.2-2025-12-11" -
"gpt-5.2-chat-latest" -
"gpt-5.2-pro" -
"gpt-5.2-pro-2025-12-11" -
"gpt-5.1" -
"gpt-5.1-2025-11-13" -
"gpt-5.1-codex" -
"gpt-5.1-mini" -
"gpt-5.1-chat-latest" -
"gpt-5" -
"gpt-5-mini" -
"gpt-5-nano" -
"gpt-5-2025-08-07" -
"gpt-5-mini-2025-08-07" -
"gpt-5-nano-2025-08-07" -
"gpt-5-chat-latest" -
"gpt-4.1" -
"gpt-4.1-mini" -
"gpt-4.1-nano" -
"gpt-4.1-2025-04-14" -
"gpt-4.1-mini-2025-04-14" -
"gpt-4.1-nano-2025-04-14" -
"o4-mini" -
"o4-mini-2025-04-16" -
"o3" -
"o3-2025-04-16" -
"o3-mini" -
"o3-mini-2025-01-31" -
"o1" -
"o1-2024-12-17" -
"o1-preview" -
"o1-preview-2024-09-12" -
"o1-mini" -
"o1-mini-2024-09-12" -
"gpt-4o" -
"gpt-4o-2024-11-20" -
"gpt-4o-2024-08-06" -
"gpt-4o-2024-05-13" -
"gpt-4o-audio-preview" -
"gpt-4o-audio-preview-2024-10-01" -
"gpt-4o-audio-preview-2024-12-17" -
"gpt-4o-audio-preview-2025-06-03" -
"gpt-4o-mini-audio-preview" -
"gpt-4o-mini-audio-preview-2024-12-17" -
"gpt-4o-search-preview" -
"gpt-4o-mini-search-preview" -
"gpt-4o-search-preview-2025-03-11" -
"gpt-4o-mini-search-preview-2025-03-11" -
"chatgpt-4o-latest" -
"codex-mini-latest" -
"gpt-4o-mini" -
"gpt-4o-mini-2024-07-18" -
"gpt-4-turbo" -
"gpt-4-turbo-2024-04-09" -
"gpt-4-0125-preview" -
"gpt-4-turbo-preview" -
"gpt-4-1106-preview" -
"gpt-4-vision-preview" -
"gpt-4" -
"gpt-4-0314" -
"gpt-4-0613" -
"gpt-4-32k" -
"gpt-4-32k-0314" -
"gpt-4-32k-0613" -
"gpt-3.5-turbo" -
"gpt-3.5-turbo-16k" -
"gpt-3.5-turbo-0301" -
"gpt-3.5-turbo-0613" -
"gpt-3.5-turbo-1106" -
"gpt-3.5-turbo-0125" -
"gpt-3.5-turbo-16k-0613"
-
-
ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more-
"o1-pro" -
"o1-pro-2025-03-19" -
"o3-pro" -
"o3-pro-2025-06-10" -
"o3-deep-research" -
"o3-deep-research-2025-06-26" -
"o4-mini-deep-research" -
"o4-mini-deep-research-2025-06-26" -
"computer-use-preview" -
"computer-use-preview-2025-03-11" -
"gpt-5-codex" -
"gpt-5-pro" -
"gpt-5-pro-2025-10-06" -
"gpt-5.1-codex-max"
-
-
-
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
-
The length and order of items in the
outputarray is dependent on the model's response. -
Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs. -
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API. -
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed, -
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
arguments: stringA JSON string of the arguments to pass to the function.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
name: stringThe name of the function to run.
-
type: "function_call"The type of the function tool call. Always
function_call. -
id: optional stringThe unique ID of the function tool call.
-
namespace: optional stringThe namespace of the function to run.
-
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API. -
type: "computer_call"The type of the computer call. Always
computer_call. -
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed. -
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
call_id: stringAn identifier used to map this custom tool call to a tool call output.
-
input: stringThe input for the custom tool call generated by the model.
-
name: stringThe name of the custom tool being called.
-
type: "custom_tool_call"The type of the custom tool call. Always
custom_tool_call. -
id: optional stringThe unique ID of the custom tool call in the OpenAI platform.
-
namespace: optional stringThe namespace of the custom tool being called.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call.-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
-
-
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
top_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
id: stringThe unique ID of the conversation that this response was associated with.
-
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
input: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response input.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
output: object { categories, category_applied_input_types, category_scores, 3 more } or object { code, message, type }Moderation for the response output.
-
moderation_result: object { categories, category_applied_input_types, category_scores, 3 more }A moderation result produced for the response input or output.
-
categories: map[boolean]A dictionary of moderation categories to booleans, True if the input is flagged under this category.
-
category_applied_input_types: map[array of "text" or "image"]Which modalities of input are reflected by the score for each category.
-
"text" -
"image"
-
-
category_scores: map[number]A dictionary of moderation categories to scores.
-
flagged: booleanA boolean indicating whether the content was flagged by any category.
-
model: stringThe moderation model that produced this result.
-
type: "moderation_result"The object type, which was always
moderation_resultfor successful moderation results.
-
-
error: object { code, message, type }An error produced while attempting moderation for the response input or output.
-
code: stringThe error code.
-
message: stringThe error message.
-
type: "error"The object type, which was always
errorfor moderation failures.
-
-
-
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
id: stringThe unique identifier of the prompt template to use.
-
variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
-
union_member_0: string -
response_input_text: object { text, type }A text input to the model.
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
-
version: optional stringOptional version of the prompt template.
-
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:-
Organizations without ZDR enabled default to
24h. -
Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified. -
"in_memory" -
"24h"
-
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
context: optional "auto" or "current_turn" or "all_turns"Controls which reasoning items are rendered back to the model on later turns. When returned on a response, this is the effective reasoning context mode used for the response.
-
"auto" -
"current_turn" -
"all_turns"
-
-
effort: optional "none" or "minimal" or "low" or 3 moreConstrains effort on reasoning for reasoning models. Currently supported values are
none,minimal,low,medium,high, andxhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.-
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1. -
All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. -
The
gpt-5-promodel defaults to (and only supports)highreasoning effort. -
xhighis supported for all models aftergpt-5.1-codex-max. -
"none" -
"minimal" -
"low" -
"medium" -
"high" -
"xhigh"
-
-
generate_summary: optional "auto" or "concise" or "detailed"Deprecated: use
summaryinstead.A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.-
"auto" -
"concise" -
"detailed"
-
-
summary: optional "auto" or "concise" or "detailed"A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. One of
auto,concise, ordetailed.conciseis supported forcomputer-use-previewmodels and all reasoning models aftergpt-5.-
"auto" -
"concise" -
"detailed"
-
-
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.-
"auto" -
"default" -
"flex" -
"scale" -
"priority"
-
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete.-
"completed" -
"failed" -
"in_progress" -
"cancelled" -
"queued" -
"incomplete"
-
-
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
format: optional ResponseFormatText or ResponseFormatTextJSONSchemaConfig or ResponseFormatJSONObjectAn 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. Usingjson_schemais preferred for models that support it.-
response_format_text: object { type }Default response format. Used to generate text responses.
-
type: "text"The type of response format being defined. Always
text.
-
-
response_format_text_json_schema_config: object { name, schema, type, 2 more }JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
-
name: stringThe name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
-
schema: map[unknown]The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
-
type: "json_schema"The type of response format being defined. Always
json_schema. -
description: optional stringA description of what the response format is for, used by the model to determine how to respond in the format.
-
strict: optional booleanWhether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the
schemafield. Only a subset of JSON Schema is supported whenstrictistrue. To learn more, read the Structured Outputs guide.
-
-
response_format_json_object: object { type }JSON object response format. An older method of generating JSON responses. Using
json_schemais recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.-
type: "json_object"The type of response format being defined. Always
json_object.
-
-
-
verbosity: optional "low" or "medium" or "high"Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are
low,medium, andhigh.-
"low" -
"medium" -
"high"
-
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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. -
disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error. -
"auto" -
"disabled"
-
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
input_tokens: numberThe number of input tokens.
-
input_tokens_details: object { cached_tokens }A detailed breakdown of the input tokens.
-
cached_tokens: numberThe number of tokens that were retrieved from the cache. More on prompt caching.
-
-
output_tokens: numberThe number of output tokens.
-
output_tokens_details: object { reasoning_tokens }A detailed breakdown of the output tokens.
-
reasoning_tokens: numberThe number of reasoning tokens.
-
-
total_tokens: numberThe total number of tokens used.
-
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.completed"The type of the event. Always
response.completed.
-
-
response_content_part_added_event: object { content_index, item_id, output_index, 3 more }Emitted when a new content part is added.
-
content_index: numberThe index of the content part that was added.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that was added.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.added"The type of the event. Always
response.content_part.added.
-
-
response_content_part_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a content part is done.
-
content_index: numberThe index of the content part that is done.
-
item_id: stringThe ID of the output item that the content part was added to.
-
output_index: numberThe index of the output item that the content part was added to.
-
part: ResponseOutputText or ResponseOutputRefusal or object { text, type }The content part that is done.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
reasoning_text: object { text, type }Reasoning text from the model.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.content_part.done"The type of the event. Always
response.content_part.done.
-
-
response_created_event: object { response, sequence_number, type }An event that is emitted when a response is created.
-
response: object { id, created_at, error, 30 more }The response that was created.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.created"The type of the event. Always
response.created.
-
-
response_error_event: object { code, message, param, 2 more }Emitted when an error occurs.
-
code: stringThe error code.
-
message: stringThe error message.
-
param: stringThe error parameter.
-
sequence_number: numberThe sequence number of this event.
-
type: "error"The type of the event. Always
error.
-
-
response_file_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is completed (results found).
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.completed"The type of the event. Always
response.file_search_call.completed.
-
-
response_file_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a file search call is initiated.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is initiated.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.in_progress"The type of the event. Always
response.file_search_call.in_progress.
-
-
response_file_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a file search is currently searching.
-
item_id: stringThe ID of the output item that the file search call is initiated.
-
output_index: numberThe index of the output item that the file search call is searching.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.file_search_call.searching"The type of the event. Always
response.file_search_call.searching.
-
-
response_function_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a partial function-call arguments delta.
-
delta: stringThe function-call arguments delta that is added.
-
item_id: stringThe ID of the output item that the function-call arguments delta is added to.
-
output_index: numberThe index of the output item that the function-call arguments delta is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.delta"The type of the event. Always
response.function_call_arguments.delta.
-
-
response_function_call_arguments_done_event: object { arguments, item_id, name, 3 more }Emitted when function-call arguments are finalized.
-
arguments: stringThe function-call arguments.
-
item_id: stringThe ID of the item.
-
name: stringThe name of the function that was called.
-
output_index: numberThe index of the output item.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.function_call_arguments.done"
-
-
response_in_progress_event: object { response, sequence_number, type }Emitted when the response is in progress.
-
response: object { id, created_at, error, 30 more }The response that is in progress.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.in_progress"The type of the event. Always
response.in_progress.
-
-
response_failed_event: object { response, sequence_number, type }An event that is emitted when a response fails.
-
response: object { id, created_at, error, 30 more }The response that failed.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.failed"The type of the event. Always
response.failed.
-
-
response_incomplete_event: object { response, sequence_number, type }An event that is emitted when a response finishes as incomplete.
-
response: object { id, created_at, error, 30 more }The response that was incomplete.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number of this event.
-
type: "response.incomplete"The type of the event. Always
response.incomplete.
-
-
response_output_item_added_event: object { item, output_index, sequence_number, type }Emitted when a new output item is added.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was added.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more } -
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more } -
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
response_tool_search_call: object { id, arguments, call_id, 4 more } -
response_tool_search_output_item: object { id, call_id, execution, 4 more } -
additional_tools: object { id, role, tools, type } -
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI. -
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
-
output_index: numberThe index of the output item that was added.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.added"The type of the event. Always
response.output_item.added.
-
-
response_output_item_done_event: object { item, output_index, sequence_number, type }Emitted when an output item is marked done.
-
item: ResponseOutputMessage or ResponseFileSearchToolCall or ResponseFunctionToolCall or 23 moreThe output item that was marked done.
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
response_function_tool_call: object { arguments, call_id, name, 4 more }A tool call to run a function. See the function calling guide for more information.
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more } -
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more } -
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context. -
response_tool_search_call: object { id, arguments, call_id, 4 more } -
response_tool_search_output_item: object { id, call_id, execution, 4 more } -
additional_tools: object { id, role, tools, type } -
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI. -
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
response_custom_tool_call: object { call_id, input, name, 3 more }A call to a custom tool created by the model.
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
-
output_index: numberThe index of the output item that was marked done.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_item.done"The type of the event. Always
response.output_item.done.
-
-
response_reasoning_summary_part_added_event: object { item_id, output_index, part, 3 more }Emitted when a new reasoning summary part is added.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The summary part that was added.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_part_done_event: object { item_id, output_index, part, 3 more }Emitted when a reasoning summary part is completed.
-
item_id: stringThe ID of the item this summary part is associated with.
-
output_index: numberThe index of the output item this summary part is associated with.
-
part: object { text, type }The completed summary part.
-
text: stringThe text of the summary part.
-
type: "summary_text"The type of the summary part. Always
summary_text.
-
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_text_delta_event: object { delta, item_id, output_index, 3 more }Emitted when a delta is added to a reasoning summary text.
-
delta: stringThe text delta that was added to the summary.
-
item_id: stringThe ID of the item this summary text delta is associated with.
-
output_index: numberThe index of the output item this summary text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe 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.
-
-
response_reasoning_summary_text_done_event: object { item_id, output_index, sequence_number, 3 more }Emitted when a reasoning summary text is completed.
-
item_id: stringThe ID of the item this summary text is associated with.
-
output_index: numberThe index of the output item this summary text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
summary_index: numberThe index of the summary part within the reasoning summary.
-
text: stringThe full text of the completed reasoning summary.
-
type: "response.reasoning_summary_text.done"The type of the event. Always
response.reasoning_summary_text.done.
-
-
response_reasoning_text_delta_event: object { content_index, delta, item_id, 3 more }Emitted when a delta is added to a reasoning text.
-
content_index: numberThe index of the reasoning content part this delta is associated with.
-
delta: stringThe text delta that was added to the reasoning content.
-
item_id: stringThe ID of the item this reasoning text delta is associated with.
-
output_index: numberThe index of the output item this reasoning text delta is associated with.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.reasoning_text.delta"The type of the event. Always
response.reasoning_text.delta.
-
-
response_reasoning_text_done_event: object { content_index, item_id, output_index, 3 more }Emitted when a reasoning text is completed.
-
content_index: numberThe index of the reasoning content part.
-
item_id: stringThe ID of the item this reasoning text is associated with.
-
output_index: numberThe index of the output item this reasoning text is associated with.
-
sequence_number: numberThe sequence number of this event.
-
text: stringThe full text of the completed reasoning content.
-
type: "response.reasoning_text.done"The type of the event. Always
response.reasoning_text.done.
-
-
response_refusal_delta_event: object { content_index, delta, item_id, 3 more }Emitted when there is a partial refusal text.
-
content_index: numberThe index of the content part that the refusal text is added to.
-
delta: stringThe refusal text that is added.
-
item_id: stringThe ID of the output item that the refusal text is added to.
-
output_index: numberThe index of the output item that the refusal text is added to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.delta"The type of the event. Always
response.refusal.delta.
-
-
response_refusal_done_event: object { content_index, item_id, output_index, 3 more }Emitted when refusal text is finalized.
-
content_index: numberThe index of the content part that the refusal text is finalized.
-
item_id: stringThe ID of the output item that the refusal text is finalized.
-
output_index: numberThe index of the output item that the refusal text is finalized.
-
refusal: stringThe refusal text that is finalized.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.refusal.done"The type of the event. Always
response.refusal.done.
-
-
response_text_delta_event: object { content_index, delta, item_id, 4 more }Emitted when there is an additional text delta.
-
content_index: numberThe index of the content part that the text delta was added to.
-
delta: stringThe text delta that was added.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text delta was added to.
-
sequence_number: numberThe sequence number for this event.
-
type: "response.output_text.delta"The type of the event. Always
response.output_text.delta.
-
-
response_text_done_event: object { content_index, item_id, logprobs, 4 more }Emitted when text content is finalized.
-
content_index: numberThe index of the content part that the text content is finalized.
-
item_id: stringThe 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.
-
token: stringA possible text token.
-
logprob: numberThe log probability of this token.
-
top_logprobs: optional array of object { token, logprob }The log probabilities of up to 20 of the most likely tokens.
-
token: optional stringA possible text token.
-
logprob: optional numberThe log probability of this token.
-
-
-
output_index: numberThe index of the output item that the text content is finalized.
-
sequence_number: numberThe sequence number for this event.
-
text: stringThe text content that is finalized.
-
type: "response.output_text.done"The type of the event. Always
response.output_text.done.
-
-
response_web_search_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is completed.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_web_search_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is initiated.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_web_search_call_searching_event: object { item_id, output_index, sequence_number, type }Emitted when a web search call is executing.
-
item_id: stringUnique ID for the output item associated with the web search call.
-
output_index: numberThe index of the output item that the web search call is associated with.
-
sequence_number: numberThe 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.
-
-
response_image_gen_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call has completed and the final image is available.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.image_generation_call.completed"The type of the event. Always 'response.image_generation_call.completed'.
-
-
response_image_gen_call_generating_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is actively generating an image (intermediate state).
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
-
response_image_gen_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an image generation tool call is in progress.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe 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'.
-
-
response_image_gen_call_partial_image_event: object { item_id, output_index, partial_image_b64, 3 more }Emitted when a partial image is available during image generation streaming.
-
item_id: stringThe unique identifier of the image generation item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
partial_image_b64: stringBase64-encoded partial image data, suitable for rendering as an image.
-
partial_image_index: number0-based index for the partial image (backend is 1-based, but this is 0-based for the user).
-
sequence_number: numberThe 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'.
-
-
response_mcp_call_arguments_delta_event: object { delta, item_id, output_index, 2 more }Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
delta: stringA JSON string containing the partial update to the arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.delta"The type of the event. Always 'response.mcp_call_arguments.delta'.
-
-
response_mcp_call_arguments_done_event: object { arguments, item_id, output_index, 2 more }Emitted when the arguments for an MCP tool call are finalized.
-
arguments: stringA JSON string containing the finalized arguments for the MCP tool call.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call_arguments.done"The type of the event. Always 'response.mcp_call_arguments.done'.
-
-
response_mcp_call_completed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has completed successfully.
-
item_id: stringThe ID of the MCP tool call item that completed.
-
output_index: numberThe index of the output item that completed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.completed"The type of the event. Always 'response.mcp_call.completed'.
-
-
response_mcp_call_failed_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.failed"The type of the event. Always 'response.mcp_call.failed'.
-
-
response_mcp_call_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when an MCP tool call is in progress.
-
item_id: stringThe unique identifier of the MCP tool call item being processed.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_call.in_progress"The type of the event. Always 'response.mcp_call.in_progress'.
-
-
response_mcp_list_tools_completed_event: object { item_id, output_index, sequence_number, type }Emitted when the list of available MCP tools has been successfully retrieved.
-
item_id: stringThe ID of the MCP tool call item that produced this output.
-
output_index: numberThe index of the output item that was processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.completed"The type of the event. Always 'response.mcp_list_tools.completed'.
-
-
response_mcp_list_tools_failed_event: object { item_id, output_index, sequence_number, type }Emitted when the attempt to list available MCP tools has failed.
-
item_id: stringThe ID of the MCP tool call item that failed.
-
output_index: numberThe index of the output item that failed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.failed"The type of the event. Always 'response.mcp_list_tools.failed'.
-
-
response_mcp_list_tools_in_progress_event: object { item_id, output_index, sequence_number, type }Emitted when the system is in the process of retrieving the list of available MCP tools.
-
item_id: stringThe ID of the MCP tool call item that is being processed.
-
output_index: numberThe index of the output item that is being processed.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.mcp_list_tools.in_progress"The type of the event. Always 'response.mcp_list_tools.in_progress'.
-
-
response_output_text_annotation_added_event: object { annotation, annotation_index, content_index, 4 more }Emitted when an annotation is added to output text content.
-
annotation: unknownThe annotation object being added. (See annotation schema for details.)
-
annotation_index: numberThe index of the annotation within the content part.
-
content_index: numberThe index of the content part within the output item.
-
item_id: stringThe unique identifier of the item to which the annotation is being added.
-
output_index: numberThe index of the output item in the response's output array.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.output_text.annotation.added"The type of the event. Always 'response.output_text.annotation.added'.
-
-
response_queued_event: object { response, sequence_number, type }Emitted when a response is queued and waiting to be processed.
-
response: object { id, created_at, error, 30 more }The full response object that is queued.
-
id: stringUnique identifier for this Response.
-
created_at: numberUnix timestamp (in seconds) of when this Response was created.
-
error: object { code, message }An error object returned when the model fails to generate a Response.
-
incomplete_details: object { reason }Details about why the response is incomplete.
-
instructions: string or array of ResponseInputItemA 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. -
metadata: map[string]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: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 moreModel ID used to generate the response, like
gpt-4ooro3. 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. -
object: "response"The object type of this resource - always set to
response. -
output: array of ResponseOutputItemAn array of content items generated by the model.
- The length and order of items in the
outputarray is dependent on the model's response. - Rather than accessing the first item in the
outputarray and assuming it's anassistantmessage with the content generated by the model, you might consider using theoutput_textproperty where supported in SDKs.
- The length and order of items in the
-
parallel_tool_calls: booleanWhether to allow the model to run tool calls in parallel.
-
temperature: numberWhat 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_pbut not both. -
tool_choice: ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 moreHow the model should select which tool (or tools) to use when generating a response. See the
toolsparameter to see how to specify which tools the model can call. -
tools: array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter.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_p: numberAn 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
temperaturebut not both. -
background: optional booleanWhether to run the model response in the background. Learn more.
-
completed_at: optional numberUnix timestamp (in seconds) of when this Response was completed. Only present when the status is
completed. -
conversation: optional object { id }The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
-
max_output_tokens: optional numberAn upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
-
max_tool_calls: optional numberThe 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.
-
moderation: optional object { input, output }Moderation results for the response input and output, if moderated completions were requested.
-
previous_response_id: optional stringThe 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 object { id, variables, version }Reference to a prompt template and its variables. Learn more.
-
prompt_cache_key: optional stringUsed by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the
userfield. Learn more. -
prompt_cache_retention: optional "in_memory" or "24h"The retention policy for the prompt cache. Set to
24hto enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. Learn more. Forgpt-5.5,gpt-5.5-pro, and future models, only24his supported.For older models that support both
in_memoryand24h, the default depends on your organization's data retention policy:- Organizations without ZDR enabled default to
24h. - Organizations with ZDR enabled default to
in_memorywhenprompt_cache_retentionis not specified.
- Organizations without ZDR enabled default to
-
reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only
Configuration options for reasoning models.
-
safety_identifier: optional stringA 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 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more.
-
service_tier: optional "auto" or "default" or "flex" or 2 moreSpecifies 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' or 'priority', then the request will be processed with the corresponding service tier.
- When not set, the default behavior is 'auto'.
When the
service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. -
status: optional "completed" or "failed" or "in_progress" or 3 moreThe status of the response generation. One of
completed,failed,in_progress,cancelled,queued, orincomplete. -
text: optional object { format, verbosity }Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:
-
top_logprobs: optional numberAn 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.
-
truncation: optional "auto" or "disabled"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.disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
-
usage: optional object { input_tokens, input_tokens_details, output_tokens, 2 more }Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
-
user: optional stringThis field is being replaced by
safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead 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.
-
-
sequence_number: numberThe sequence number for this event.
-
type: "response.queued"The type of the event. Always 'response.queued'.
-
-
response_custom_tool_call_input_delta_event: object { delta, item_id, output_index, 2 more }Event representing a delta (partial update) to the input of a custom tool call.
-
delta: stringThe incremental input data (delta) for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this delta applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.delta"The event type identifier.
-
-
response_custom_tool_call_input_done_event: object { input, item_id, output_index, 2 more }Event indicating that input for a custom tool call is complete.
-
input: stringThe complete input data for the custom tool call.
-
item_id: stringUnique identifier for the API item associated with this event.
-
output_index: numberThe index of the output this event applies to.
-
sequence_number: numberThe sequence number of this event.
-
type: "response.custom_tool_call_input.done"The event type identifier.
-
-
Skill Reference
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
Tool
-
tool: FunctionTool or FileSearchTool or ComputerTool or 12 moreA tool that can be used to generate a response.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
Tool Choice Allowed
-
tool_choice_allowed: object { mode, tools, type }Constrains the tools available to the model to a pre-defined set.
-
mode: "auto" or "required"Constrains the tools available to the model to a pre-defined set.
autoallows the model to pick from among the allowed tools and generate a message.requiredrequires the model to call one or more of the allowed tools.-
"auto" -
"required"
-
-
tools: array of map[unknown]A list of tool definitions that the model should be allowed to call.
For the Responses API, the list of tool definitions might look like:
[ { "type": "function", "name": "get_weather" }, { "type": "mcp", "server_label": "deepwiki" }, { "type": "image_generation" } ] -
type: "allowed_tools"Allowed tool configuration type. Always
allowed_tools.
-
Tool Choice Apply Patch
-
tool_choice_apply_patch: object { type }Forces the model to call the apply_patch tool when executing a tool call.
-
type: "apply_patch"The tool to call. Always
apply_patch.
-
Tool Choice Custom
-
tool_choice_custom: object { name, type }Use this option to force the model to call a specific custom tool.
-
name: stringThe name of the custom tool to call.
-
type: "custom"For custom tool calling, the type is always
custom.
-
Tool Choice Function
-
tool_choice_function: object { name, type }Use this option to force the model to call a specific function.
-
name: stringThe name of the function to call.
-
type: "function"For function calling, the type is always
function.
-
Tool Choice Mcp
-
tool_choice_mcp: object { server_label, type, name }Use this option to force the model to call a specific tool on a remote MCP server.
-
server_label: stringThe label of the MCP server to use.
-
type: "mcp"For MCP tools, the type is always
mcp. -
name: optional stringThe name of the tool to call on the server.
-
Tool Choice Options
-
tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.-
"none" -
"auto" -
"required"
-
Tool Choice Shell
-
tool_choice_shell: object { type }Forces the model to call the shell tool when a tool call is required.
-
type: "shell"The tool to call. Always
shell.
-
Tool Choice Types
-
tool_choice_types: object { type }Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
type: "file_search" or "web_search_preview" or "computer" or 5 moreThe type of hosted tool the model should to use. Learn more about built-in tools.
Allowed values are:
-
file_search -
web_search_preview -
computer -
computer_use_preview -
computer_use -
code_interpreter -
image_generation -
"file_search" -
"web_search_preview" -
"computer" -
"computer_use_preview" -
"computer_use" -
"web_search_preview_2025_03_11" -
"image_generation" -
"code_interpreter"
-
-
Tool Search Tool
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
Web Search Preview Tool
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
Web Search Tool
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
Input Items
List input items
$ openai responses:input-items list
get /responses/{response_id}/input_items
Returns a list of input items for a given response.
Parameters
-
--response-id: stringThe ID of the response to retrieve input items for.
-
--after: optional stringAn item ID to list items after, used in pagination.
-
--include: optional array of ResponseIncludableAdditional fields to include in the response. See the
includeparameter for Response creation above for more information. -
--limit: optional numberA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
-
--order: optional "asc" or "desc"The order to return the input items in. Default is
desc.asc: Return the input items in ascending order.desc: Return the input items in descending order.
Returns
-
responseItemList: object { data, first_id, has_more, 2 more }A list of Response items.
-
data: array of ResponseItemA list of items used to generate this response.
-
response_input_message_item: object { id, content, role, 2 more }-
id: stringThe unique ID of the message input.
-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
type: "message"The type of the message input. Always set to
message. -
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call_item: ResponseFunctionToolCallA tool call to run a function. See the function calling guide for more information.
-
id: stringThe unique ID of the function tool call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_item: ResponseCustomToolCallA call to a custom tool created by the model.
-
id: stringThe unique ID of the custom tool call item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
first_id: stringThe ID of the first item in the list.
-
has_more: booleanWhether there are more items available.
-
last_id: stringThe ID of the last item in the list.
-
object: "list"The type of object returned, must be
list.
-
Example
openai responses:input-items list \
--api-key 'My API Key' \
--response-id response_id
Response
{
"data": [
{
"id": "id",
"content": [
{
"text": "text",
"type": "input_text"
}
],
"role": "user",
"type": "message",
"status": "in_progress"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}
Domain Types
Response Item List
-
responseItemList: object { data, first_id, has_more, 2 more }A list of Response items.
-
data: array of ResponseItemA list of items used to generate this response.
-
response_input_message_item: object { id, content, role, 2 more }-
id: stringThe unique ID of the message input.
-
content: array of ResponseInputContentA list of one or many input items to the model, containing different content types.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto.-
"low" -
"high" -
"auto" -
"original"
-
-
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow.-
"low" -
"high"
-
-
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
role: "user" or "system" or "developer"The role of the message input. One of
user,system, ordeveloper.-
"user" -
"system" -
"developer"
-
-
type: "message"The type of the message input. Always set to
message. -
status: optional "in_progress" or "completed" or "incomplete"The status of item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_output_message: object { id, content, role, 3 more }An output message from the model.
-
id: stringThe unique ID of the output message.
-
content: array of ResponseOutputText or ResponseOutputRefusalThe content of the output message.
-
response_output_text: object { annotations, text, type, logprobs }A text output from the model.
-
annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }The annotations of the text output.
-
file_citation: object { file_id, filename, index, type }A citation to a file.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the file cited.
-
index: numberThe index of the file in the list of files.
-
type: "file_citation"The type of the file citation. Always
file_citation.
-
-
url_citation: object { end_index, start_index, title, 2 more }A citation for a web resource used to generate a model response.
-
end_index: numberThe index of the last character of the URL citation in the message.
-
start_index: numberThe index of the first character of the URL citation in the message.
-
title: stringThe title of the web resource.
-
type: "url_citation"The type of the URL citation. Always
url_citation. -
url: stringThe URL of the web resource.
-
-
container_file_citation: object { container_id, end_index, file_id, 3 more }A citation for a container file used to generate a model response.
-
container_id: stringThe ID of the container file.
-
end_index: numberThe index of the last character of the container file citation in the message.
-
file_id: stringThe ID of the file.
-
filename: stringThe filename of the container file cited.
-
start_index: numberThe index of the first character of the container file citation in the message.
-
type: "container_file_citation"The type of the container file citation. Always
container_file_citation.
-
-
file_path: object { file_id, index, type }A path to a file.
-
file_id: stringThe ID of the file.
-
index: numberThe index of the file in the list of files.
-
type: "file_path"The type of the file path. Always
file_path.
-
-
-
text: stringThe text output from the model.
-
type: "output_text"The type of the output text. Always
output_text. -
logprobs: optional array of object { token, bytes, logprob, top_logprobs }-
token: string -
bytes: array of number -
logprob: number -
top_logprobs: array of object { token, bytes, logprob }-
token: string -
bytes: array of number -
logprob: number
-
-
-
-
response_output_refusal: object { refusal, type }A refusal from the model.
-
refusal: stringThe refusal explanation from the model.
-
type: "refusal"The type of the refusal. Always
refusal.
-
-
-
role: "assistant"The role of the output message. Always
assistant. -
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "message"The type of the output message. Always
message. -
phase: optional "commentary" or "final_answer"Labels an
assistantmessage as intermediate commentary (commentary) or the final answer (final_answer). For models likegpt-5.3-codexand beyond, when sending follow-up requests, preserve and resend phase on all assistant messages — dropping it can degrade performance. Not used for user messages.-
"commentary" -
"final_answer"
-
-
-
response_file_search_tool_call: object { id, queries, status, 2 more }The results of a file search tool call. See the file search guide for more information.
-
id: stringThe unique ID of the file search tool call.
-
queries: array of stringThe queries used to search for files.
-
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of
in_progress,searching,incompleteorfailed,-
"in_progress" -
"searching" -
"completed" -
"incomplete" -
"failed"
-
-
type: "file_search_call"The type of the file search tool call. Always
file_search_call. -
results: optional array of object { attributes, file_id, filename, 2 more }The results of the file search tool call.
-
attributes: optional map[string or number or boolean]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, booleans, or numbers.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean
-
-
file_id: optional stringThe unique ID of the file.
-
filename: optional stringThe name of the file.
-
score: optional numberThe relevance score of the file - a value between 0 and 1.
-
text: optional stringThe text that was retrieved from the file.
-
-
-
response_computer_tool_call: object { id, call_id, pending_safety_checks, 4 more }A tool call to a computer use tool. See the computer use guide for more information.
-
id: stringThe unique ID of the computer call.
-
call_id: stringAn identifier used when responding to the tool call with output.
-
pending_safety_checks: array of object { id, code, message }The pending safety checks for the computer call.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "computer_call"The type of the computer call. Always
computer_call."computer_call"
-
action: optional object { button, type, x, 2 more } or object { keys, type, x, y } or object { path, type, keys } or 6 moreA click action.
-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
actions: optional array of ComputerActionFlattened batched actions for
computer_use. Each action includes antypediscriminator and action-specific fields.-
click: object { button, type, x, 2 more }A click action.
-
button: "left" or "right" or "wheel" or 2 moreIndicates which mouse button was pressed during the click. One of
left,right,wheel,back, orforward.-
"left" -
"right" -
"wheel" -
"back" -
"forward"
-
-
type: "click"Specifies the event type. For a click action, this property is always
click. -
x: numberThe x-coordinate where the click occurred.
-
y: numberThe y-coordinate where the click occurred.
-
keys: optional array of stringThe keys being held while clicking.
-
-
double_click: object { keys, type, x, y }A double click action.
-
keys: array of stringThe keys being held while double-clicking.
-
type: "double_click"Specifies the event type. For a double click action, this property is always set to
double_click. -
x: numberThe x-coordinate where the double click occurred.
-
y: numberThe y-coordinate where the double click occurred.
-
-
drag: object { path, type, keys }A drag action.
-
path: array of object { x, y }An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg
[ { x: 100, y: 200 }, { x: 200, y: 300 } ]-
x: numberThe x-coordinate.
-
y: numberThe y-coordinate.
-
-
type: "drag"Specifies the event type. For a drag action, this property is always set to
drag. -
keys: optional array of stringThe keys being held while dragging the mouse.
-
-
keypress: object { keys, type }A collection of keypresses the model would like to perform.
-
keys: array of stringThe combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
-
type: "keypress"Specifies the event type. For a keypress action, this property is always set to
keypress.
-
-
move: object { type, x, y, keys }A mouse move action.
-
type: "move"Specifies the event type. For a move action, this property is always set to
move. -
x: numberThe x-coordinate to move to.
-
y: numberThe y-coordinate to move to.
-
keys: optional array of stringThe keys being held while moving the mouse.
-
-
screenshot: object { type }A screenshot action.
-
scroll: object { scroll_x, scroll_y, type, 3 more }A scroll action.
-
scroll_x: numberThe horizontal scroll distance.
-
scroll_y: numberThe vertical scroll distance.
-
type: "scroll"Specifies the event type. For a scroll action, this property is always set to
scroll. -
x: numberThe x-coordinate where the scroll occurred.
-
y: numberThe y-coordinate where the scroll occurred.
-
keys: optional array of stringThe keys being held while scrolling.
-
-
type: object { text, type }An action to type in text.
-
text: stringThe text to type.
-
type: "type"Specifies the event type. For a type action, this property is always set to
type.
-
-
wait: object { type }A wait action.
-
-
-
response_computer_tool_call_output_item: object { id, call_id, output, 4 more }-
id: stringThe unique ID of the computer call tool output.
-
call_id: stringThe ID of the computer tool call that produced the output.
-
output: object { type, file_id, image_url }A computer screenshot image used with the computer use tool.
-
type: "computer_screenshot"Specifies the event type. For a computer screenshot, this property is always set to
computer_screenshot. -
file_id: optional stringThe identifier of an uploaded file that contains the screenshot.
-
image_url: optional stringThe URL of the screenshot image.
-
-
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of
in_progress,completed, orincomplete. Populated when input items are returned via API.-
"completed" -
"incomplete" -
"failed" -
"in_progress"
-
-
type: "computer_call_output"The type of the computer tool call output. Always
computer_call_output. -
acknowledged_safety_checks: optional array of object { id, code, message }The safety checks reported by the API that have been acknowledged by the developer.
-
id: stringThe ID of the pending safety check.
-
code: optional stringThe type of the pending safety check.
-
message: optional stringDetails about the pending safety check.
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_web_search: object { id, action, status, type }The results of a web search tool call. See the web search guide for more information.
-
id: stringThe unique ID of the web search tool call.
-
action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page).
-
search: object { type, queries, query, sources }Action type "search" - Performs a web search query.
-
type: "search"The action type.
-
queries: optional array of stringThe search queries.
-
query: optional stringThe search query.
-
sources: optional array of object { type, url }The sources used in the search.
-
type: "url"The type of source. Always
url. -
url: stringThe URL of the source.
-
-
-
open_page: object { type, url }Action type "open_page" - Opens a specific URL from search results.
-
type: "open_page"The action type.
-
url: optional stringThe URL opened by the model.
-
-
find_in_page: object { pattern, type, url }Action type "find_in_page": Searches for a pattern within a loaded page.
-
pattern: stringThe pattern or text to search for within the page.
-
type: "find_in_page"The action type.
-
url: stringThe URL of the page searched for the pattern.
-
-
-
status: "in_progress" or "searching" or "completed" or "failed"The status of the web search tool call.
-
"in_progress" -
"searching" -
"completed" -
"failed"
-
-
type: "web_search_call"The type of the web search tool call. Always
web_search_call.
-
-
response_function_tool_call_item: ResponseFunctionToolCallA tool call to run a function. See the function calling guide for more information.
-
id: stringThe unique ID of the function tool call.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_function_tool_call_output_item: object { id, call_id, output, 3 more }-
id: stringThe unique ID of the function call tool output.
-
call_id: stringThe unique ID of the function tool call generated by the model.
-
output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFileThe output from the function call generated by your code. Can be a string or an list of output content.
-
string output: stringA string of the output of the function call.
-
output content list: array of ResponseInputText or ResponseInputImage or ResponseInputFileText, image, or file output of the function call.
-
response_input_text: object { text, type }A text input to the model.
-
text: stringThe text input to the model.
-
type: "input_text"The type of the input item. Always
input_text.
-
-
response_input_image: object { detail, type, file_id, image_url }An image input to the model. Learn about image inputs.
-
detail: "low" or "high" or "auto" or "original"The detail level of the image to be sent to the model. One of
high,low,auto, ororiginal. Defaults toauto. -
type: "input_image"The type of the input item. Always
input_image. -
file_id: optional stringThe ID of the file to be sent to the model.
-
image_url: optional stringThe URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
-
-
response_input_file: object { type, detail, file_data, 3 more }A file input to the model.
-
type: "input_file"The type of the input item. Always
input_file. -
detail: optional "low" or "high"The detail level of the file to be sent to the model. Use
lowfor the default rendering behavior, orhighto render the file at higher quality. Defaults tolow. -
file_data: optional stringThe content of the file to be sent to the model.
-
file_id: optional stringThe ID of the file to be sent to the model.
-
file_url: optional stringThe URL of the file to be sent to the model.
-
filename: optional stringThe name of the file to be sent to the model.
-
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "function_call_output"The type of the function tool call output. Always
function_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_call: object { id, arguments, call_id, 4 more }-
id: stringThe unique ID of the tool search call item.
-
arguments: unknownArguments used for the tool search call.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "tool_search_call"The type of the item. Always
tool_search_call. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_tool_search_output_item: object { id, call_id, execution, 4 more }-
id: stringThe unique ID of the tool search output item.
-
call_id: stringThe unique ID of the tool search call generated by the model.
-
execution: "server" or "client"Whether tool search was executed by the server or by the client.
-
"server" -
"client"
-
-
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
-
"in_progress" -
"completed" -
"incomplete"
-
-
tools: array of ToolThe loaded tool definitions returned by tool search.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
name: stringThe name of the function to call.
-
parameters: map[unknown]A JSON schema object describing the parameters of the function.
-
strict: booleanWhether to enforce strict parameter validation. Default
true. -
type: "function"The type of the function tool. Always
function. -
defer_loading: optional booleanWhether this function is deferred and loaded via tool search.
-
description: optional stringA description of the function. Used by the model to determine whether or not to call the function.
-
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
type: "file_search"The type of the file search tool. Always
file_search. -
vector_store_ids: array of stringThe IDs of the vector stores to search.
-
filters: optional ComparisonFilter or CompoundFilterA filter to apply.
-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
key: stringThe key to compare against the value.
-
type: "eq" or "ne" or "gt" or 5 moreSpecifies the comparison operator:
eq,ne,gt,gte,lt,lte,in,nin.-
eq: equals -
ne: not equal -
gt: greater than -
gte: greater than or equal -
lt: less than -
lte: less than or equal -
in: in -
nin: not in -
"eq" -
"ne" -
"gt" -
"gte" -
"lt" -
"lte" -
"in" -
"nin"
-
-
value: string or number or boolean or array of string or numberThe value to compare against the attribute key; supports string, number, or boolean types.
-
union_member_0: string -
union_member_1: number -
union_member_2: boolean -
union_member_3: array of string or number-
union_member_0: string -
union_member_1: number
-
-
-
-
compound_filter: object { filters, type }Combine multiple filters using
andoror.-
filters: array of ComparisonFilter or unknownArray of filters to combine. Items can be
ComparisonFilterorCompoundFilter.-
comparison_filter: object { key, type, value }A filter used to compare a specified attribute key to a given value using a defined comparison operation.
-
union_member_1: unknown
-
-
type: "and" or "or"Type of operation:
andoror.-
"and" -
"or"
-
-
-
-
max_num_results: optional numberThe maximum number of results to return. This number should be between 1 and 50 inclusive.
-
ranking_options: optional object { hybrid_search, ranker, score_threshold }Ranking options for search.
-
hybrid_search: optional object { embedding_weight, text_weight }Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled.
-
embedding_weight: numberThe weight of the embedding in the reciprocal ranking fusion.
-
text_weight: numberThe weight of the text in the reciprocal ranking fusion.
-
-
ranker: optional "auto" or "default-2024-11-15"The ranker to use for the file search.
-
"auto" -
"default-2024-11-15"
-
-
score_threshold: optional numberThe score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
-
-
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
type: "computer"The type of the computer tool. Always
computer.
-
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
display_height: numberThe height of the computer display.
-
display_width: numberThe width of the computer display.
-
environment: "windows" or "mac" or "linux" or 2 moreThe type of computer environment to control.
-
"windows" -
"mac" -
"linux" -
"ubuntu" -
"browser"
-
-
type: "computer_use_preview"The type of the computer use tool. Always
computer_use_preview.
-
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
type: "web_search" or "web_search_2025_08_26"The type of the web search tool. One of
web_searchorweb_search_2025_08_26.-
"web_search" -
"web_search_2025_08_26"
-
-
filters: optional object { allowed_domains }Filters for the search.
-
allowed_domains: optional array of stringAllowed domains for the search. If not provided, all domains are allowed. Subdomains of the provided domains are allowed as well.
Example:
["pubmed.ncbi.nlm.nih.gov"]
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { city, country, region, 2 more }The approximate location of the user.
-
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles. -
type: optional "approximate"The type of location approximation. Always
approximate."approximate"
-
-
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
server_label: stringA label for this MCP server, used to identify it in tool calls.
-
type: "mcp"The type of the MCP tool. Always
mcp. -
allowed_tools: optional array of string or object { read_only, tool_names }List of allowed tool names or a filter object.
-
MCP allowed tools: array of stringA string array of allowed tool names
-
MCP tool filter: object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
authorization: optional stringAn OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
-
connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 moreIdentifier for service connectors, like those available in ChatGPT. One of
server_url,connector_id, ortunnel_idmust be provided. Learn more about service connectors here.Currently supported
connector_idvalues are:-
Dropbox:
connector_dropbox -
Gmail:
connector_gmail -
Google Calendar:
connector_googlecalendar -
Google Drive:
connector_googledrive -
Microsoft Teams:
connector_microsoftteams -
Outlook Calendar:
connector_outlookcalendar -
Outlook Email:
connector_outlookemail -
SharePoint:
connector_sharepoint -
"connector_dropbox" -
"connector_gmail" -
"connector_googlecalendar" -
"connector_googledrive" -
"connector_microsoftteams" -
"connector_outlookcalendar" -
"connector_outlookemail" -
"connector_sharepoint"
-
-
defer_loading: optional booleanWhether this MCP tool is deferred and discovered via tool search.
-
headers: optional map[string]Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
-
require_approval: optional object { always, never } or "always" or "never"Specify which of the MCP server's tools require approval.
-
MCP tool approval filter: object { always, never }Specify which of the MCP server's tools require approval. Can be
always,never, or a filter object associated with tools that require approval.-
always: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
never: optional object { read_only, tool_names }A filter object to specify which tools are allowed.
-
read_only: optional booleanIndicates whether or not a tool modifies data or is read-only. If an MCP server is annotated with
readOnlyHint, it will match this filter. -
tool_names: optional array of stringList of allowed tool names.
-
-
-
MCP tool approval setting: "always" or "never"Specify a single approval policy for all tools. One of
alwaysornever. When set toalways, all tools will require approval. When set tonever, all tools will not require approval.-
"always" -
"never"
-
-
-
server_description: optional stringOptional description of the MCP server, used to provide more context.
-
server_url: optional stringThe URL for the MCP server. One of
server_url,connector_id, ortunnel_idmust be provided. -
tunnel_id: optional stringThe Secure MCP Tunnel ID to use instead of a direct server URL. One of
server_url,connector_id, ortunnel_idmust be provided.
-
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
container: string or object { type, file_ids, memory_limit, network_policy }The code interpreter container. Can be a container ID or an object that specifies uploaded file IDs to make available to your code, along with an optional
memory_limitsetting.-
union_member_0: stringThe container ID.
-
CodeInterpreterToolAuto: object { type, file_ids, memory_limit, network_policy }Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
-
type: "auto"Always
auto. -
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the code interpreter container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type }-
type: "disabled"Disable outbound network access. Always
disabled.
-
-
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }-
allowed_domains: array of stringA list of allowed domains when type is
allowlist. -
type: "allowlist"Allow outbound network access only to specified domains. Always
allowlist. -
domain_secrets: optional array of ContainerNetworkPolicyDomainSecretOptional domain-scoped secrets for allowlisted domains.
-
domain: stringThe domain associated with the secret.
-
name: stringThe name of the secret to inject for the domain.
-
value: stringThe secret value to inject for the domain.
-
-
-
-
-
-
type: "code_interpreter"The type of the code interpreter tool. Always
code_interpreter.
-
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
type: "image_generation"The type of the image generation tool. Always
image_generation. -
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default:
auto.-
"generate" -
"edit" -
"auto"
-
-
background: optional "transparent" or "opaque" or "auto"Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of
transparent,opaque, orauto(default value). Whenautois used, the model will automatically determine the best background for the image.gpt-image-2andgpt-image-2-2026-04-21do not support transparent backgrounds. Requests withbackgroundset totransparentwill return an error for these models; useopaqueorautoinstead.If
transparent, the output format needs to support transparency, so it should be set to eitherpng(default value) orwebp.-
"transparent" -
"opaque" -
"auto"
-
-
input_fidelity: optional "high" or "low"Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for
gpt-image-1andgpt-image-1.5and later models, unsupported forgpt-image-1-mini. Supportshighandlow. Defaults tolow.-
"high" -
"low"
-
-
input_image_mask: optional object { file_id, image_url }Optional mask for inpainting. Contains
image_url(string, optional) andfile_id(string, optional).-
file_id: optional stringFile ID for the mask image.
-
image_url: optional stringBase64-encoded mask image.
-
-
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 3 moreThe image generation model to use. Default:
gpt-image-1.-
"gpt-image-1" -
"gpt-image-1-mini" -
"gpt-image-2" -
"gpt-image-2-2026-04-21" -
"gpt-image-1.5" -
"chatgpt-image-latest"
-
-
moderation: optional "auto" or "low"Moderation level for the generated image. Default:
auto.-
"auto" -
"low"
-
-
output_compression: optional numberCompression level for the output image. Default: 100.
-
output_format: optional "png" or "webp" or "jpeg"The output format of the generated image. One of
png,webp, orjpeg. Default:png.-
"png" -
"webp" -
"jpeg"
-
-
partial_images: optional numberNumber of partial images to generate in streaming mode, from 0 (default value) to 3.
-
quality: optional "low" or "medium" or "high" or "auto"The quality of the generated image. One of
low,medium,high, orauto. Default:auto.-
"low" -
"medium" -
"high" -
"auto"
-
-
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For
gpt-image-2andgpt-image-2-2026-04-21, arbitrary resolutions are supported asWIDTHxHEIGHTstrings, for example1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above2560x1440are experimental, and the maximum supported resolution is3840x2160. The requested size must also satisfy the model's current pixel and edge limits. The standard sizes1024x1024,1536x1024, and1024x1536are supported by the GPT image models;autois supported for models that allow automatic sizing. Fordall-e-2, use one of256x256,512x512, or1024x1024. Fordall-e-3, use one of1024x1024,1792x1024, or1024x1792.-
"1024x1024" -
"1024x1536" -
"1536x1024" -
"auto"
-
-
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
type: "shell"The type of the shell tool. Always
shell. -
environment: optional ContainerAuto or LocalEnvironment or ContainerReference-
container_auto: object { type, file_ids, memory_limit, 2 more }-
type: "container_auto"Automatically creates a container for this request
-
file_ids: optional array of stringAn optional list of uploaded files to make available to your code.
-
memory_limit: optional "1g" or "4g" or "16g" or "64g"The memory limit for the container.
-
"1g" -
"4g" -
"16g" -
"64g"
-
-
network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlistNetwork access policy for the container.
-
container_network_policy_disabled: object { type } -
container_network_policy_allowlist: object { allowed_domains, type, domain_secrets }
-
-
skills: optional array of SkillReference or InlineSkillAn optional list of skills referenced by id or inline data.
-
skill_reference: object { skill_id, type, version }-
skill_id: stringThe ID of the referenced skill.
-
type: "skill_reference"References a skill created with the /v1/skills endpoint.
-
version: optional stringOptional skill version. Use a positive integer or 'latest'. Omit for default.
-
-
inline_skill: object { description, name, source, type }-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
source: object { data, media_type, type }Inline skill payload
-
data: stringBase64-encoded skill zip bundle.
-
media_type: "application/zip"The media type of the inline skill payload. Must be
application/zip. -
type: "base64"The type of the inline skill source. Must be
base64.
-
-
type: "inline"Defines an inline skill for this request.
-
-
-
-
local_environment: object { type, skills }-
type: "local"Use a local computer environment.
-
skills: optional array of LocalSkillAn optional list of skills.
-
description: stringThe description of the skill.
-
name: stringThe name of the skill.
-
path: stringThe path to the directory containing the skill.
-
-
-
container_reference: object { container_id, type }-
container_id: stringThe ID of the referenced container.
-
type: "container_reference"References a container created with the /v1/containers endpoint
-
-
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
text: object { type }Unconstrained free-form text.
-
grammar: object { definition, syntax, type }A grammar defined by the user.
-
definition: stringThe grammar definition.
-
syntax: "lark" or "regex"The syntax of the grammar definition. One of
larkorregex.-
"lark" -
"regex"
-
-
type: "grammar"Grammar format. Always
grammar.
-
-
-
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
description: stringA description of the namespace shown to the model.
-
name: stringThe namespace name used in tool calls (for example,
crm). -
tools: array of object { name, type, defer_loading, 3 more } or CustomToolThe function/custom tools available inside this namespace.
-
function: object { name, type, defer_loading, 3 more }-
name: string -
type: "function" -
defer_loading: optional booleanWhether this function should be deferred and discovered via tool search.
-
description: optional string -
parameters: optional unknown -
strict: optional boolean
-
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
name: stringThe name of the custom tool, used to identify it in tool calls.
-
type: "custom"The type of the custom tool. Always
custom. -
defer_loading: optional booleanWhether this tool should be deferred and discovered via tool search.
-
description: optional stringOptional description of the custom tool, used to provide more context.
-
format: optional object { type } or object { definition, syntax, type }The input format for the custom tool. Default is unconstrained text.
-
-
-
type: "namespace"The type of the tool. Always
namespace.
-
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
type: "tool_search"The type of the tool. Always
tool_search. -
description: optional stringDescription shown to the model for a client-executed tool search tool.
-
execution: optional "server" or "client"Whether tool search is executed by the server or by the client.
-
"server" -
"client"
-
-
parameters: optional unknownParameter schema for a client-executed tool search tool.
-
-
web_search_preview_tool: object { 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.
-
type: "web_search_preview" or "web_search_preview_2025_03_11"The type of the web search tool. One of
web_search_previeworweb_search_preview_2025_03_11.-
"web_search_preview" -
"web_search_preview_2025_03_11"
-
-
search_content_types: optional array of "text" or "image"-
"text" -
"image"
-
-
search_context_size: optional "low" or "medium" or "high"High level guidance for the amount of context window space to use for the search. One of
low,medium, orhigh.mediumis the default.-
"low" -
"medium" -
"high"
-
-
user_location: optional object { type, city, country, 2 more }The user's location.
-
type: "approximate"The type of location approximation. Always
approximate. -
city: optional stringFree text input for the city of the user, e.g.
San Francisco. -
country: optional stringThe two-letter ISO country code of the user, e.g.
US. -
region: optional stringFree text input for the region of the user, e.g.
California. -
timezone: optional stringThe IANA timezone of the user, e.g.
America/Los_Angeles.
-
-
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
type: "apply_patch"The type of the tool. Always
apply_patch.
-
-
-
type: "tool_search_output"The type of the item. Always
tool_search_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
additional_tools: object { id, role, tools, type }-
id: stringThe unique ID of the additional tools item.
-
role: "unknown" or "user" or "assistant" or 5 moreThe role that provided the additional tools.
-
"unknown" -
"user" -
"assistant" -
"system" -
"critic" -
"discriminator" -
"developer" -
"tool"
-
-
tools: array of ToolThe additional tool definitions made available at this item.
-
function_tool: object { name, parameters, strict, 3 more }Defines a function in your own code the model can choose to call. Learn more about function calling.
-
file_search_tool: object { type, vector_store_ids, filters, 2 more }A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
-
computer_tool: object { type }A tool that controls a virtual computer. Learn more about the computer tool.
-
computer_use_preview_tool: object { display_height, display_width, environment, type }A tool that controls a virtual computer. Learn more about the computer tool.
-
web_search_tool: object { type, filters, search_context_size, user_location }Search the Internet for sources related to the prompt. Learn more about the web search tool.
-
mcp: object { server_label, type, allowed_tools, 8 more }Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
code_interpreter: object { container, type }A tool that runs Python code to help generate a response to a prompt.
-
image_generation: object { type, action, background, 9 more }A tool that generates images using the GPT image models.
-
local_shell: object { type }A tool that allows the model to execute shell commands in a local environment.
-
function_shell_tool: object { type, environment }A tool that allows the model to execute shell commands.
-
custom_tool: object { name, type, defer_loading, 2 more }A custom tool that processes input using a specified format. Learn more about custom tools
-
namespace_tool: object { description, name, tools, type }Groups function/custom tools under a shared namespace.
-
tool_search_tool: object { type, description, execution, parameters }Hosted or BYOT tool search configuration for deferred tools.
-
web_search_preview_tool: object { 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.
-
apply_patch_tool: object { type }Allows the assistant to create, delete, or update files using unified diffs.
-
-
type: "additional_tools"The type of the item. Always
additional_tools.
-
-
response_reasoning_item: object { id, summary, type, 3 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
inputto the Responses API for subsequent turns of a conversation if you are manually managing context.-
id: stringThe unique identifier of the reasoning content.
-
summary: array of object { text, type }Reasoning summary content.
-
text: stringA summary of the reasoning output from the model so far.
-
type: "summary_text"The type of the object. Always
summary_text.
-
-
type: "reasoning"The type of the object. Always
reasoning. -
content: optional array of object { text, type }Reasoning text content.
-
text: stringThe reasoning text from the model.
-
type: "reasoning_text"The type of the reasoning text. Always
reasoning_text.
-
-
encrypted_content: optional stringThe encrypted content of the reasoning item - populated when a response is generated with
reasoning.encrypted_contentin theincludeparameter. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_compaction_item: object { id, encrypted_content, type, created_by }A compaction item generated by the
v1/responses/compactAPI.-
id: stringThe unique ID of the compaction item.
-
encrypted_content: stringThe encrypted content that was produced by compaction.
-
type: "compaction"The type of the item. Always
compaction. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
image_generation_call: object { id, result, status, type }An image generation request made by the model.
-
id: stringThe unique ID of the image generation call.
-
result: stringThe generated image encoded in base64.
-
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
-
"in_progress" -
"completed" -
"generating" -
"failed"
-
-
type: "image_generation_call"The type of the image generation call. Always
image_generation_call.
-
-
response_code_interpreter_tool_call: object { id, code, container_id, 3 more }A tool call to run code.
-
id: stringThe unique ID of the code interpreter tool call.
-
code: stringThe code to run, or null if not available.
-
container_id: stringThe ID of the container used to run the code.
-
outputs: array of object { logs, type } or object { type, url }The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
-
logs: object { logs, type }The logs output from the code interpreter.
-
logs: stringThe logs output from the code interpreter.
-
type: "logs"The type of the output. Always
logs.
-
-
image: object { type, url }The image output from the code interpreter.
-
type: "image"The type of the output. Always
image. -
url: stringThe URL of the image output from the code interpreter.
-
-
-
status: "in_progress" or "completed" or "incomplete" or 2 moreThe status of the code interpreter tool call. Valid values are
in_progress,completed,incomplete,interpreting, andfailed.-
"in_progress" -
"completed" -
"incomplete" -
"interpreting" -
"failed"
-
-
type: "code_interpreter_call"The type of the code interpreter tool call. Always
code_interpreter_call.
-
-
local_shell_call: object { id, action, call_id, 2 more }A tool call to run a command on the local shell.
-
id: stringThe unique ID of the local shell call.
-
action: object { command, env, type, 3 more }Execute a shell command on the server.
-
command: array of stringThe command to run.
-
env: map[string]Environment variables to set for the command.
-
type: "exec"The type of the local shell action. Always
exec. -
timeout_ms: optional numberOptional timeout in milliseconds for the command.
-
user: optional stringOptional user to run the command as.
-
working_directory: optional stringOptional working directory to run the command in.
-
-
call_id: stringThe unique ID of the local shell tool call generated by the model.
-
status: "in_progress" or "completed" or "incomplete"The status of the local shell call.
-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "local_shell_call"The type of the local shell call. Always
local_shell_call.
-
-
local_shell_call_output: object { id, output, type, status }The output of a local shell tool call.
-
id: stringThe unique ID of the local shell tool call generated by the model.
-
output: stringA JSON string of the output of the local shell tool call.
-
type: "local_shell_call_output"The type of the local shell tool call output. Always
local_shell_call_output. -
status: optional "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
-
response_function_shell_tool_call: object { id, action, call_id, 4 more }A tool call that executes one or more shell commands in a managed environment.
-
id: stringThe unique ID of the shell tool call. Populated when this item is returned via API.
-
action: object { commands, max_output_length, timeout_ms }The shell commands and limits that describe how to run the tool call.
-
commands: array of string -
max_output_length: numberOptional maximum number of characters to return from each command.
-
timeout_ms: numberOptional timeout in milliseconds for the commands.
-
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
environment: ResponseLocalEnvironment or ResponseContainerReferenceRepresents the use of a local environment to perform shell actions.
-
response_local_environment: object { type }Represents the use of a local environment to perform shell actions.
-
type: "local"The environment type. Always
local.
-
-
response_container_reference: object { container_id, type }Represents a container created with /v1/containers.
-
container_id: string -
type: "container_reference"The environment type. Always
container_reference.
-
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call"The type of the item. Always
shell_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_function_shell_tool_call_output: object { id, call_id, max_output_length, 4 more }The output of a shell tool call that was emitted.
-
id: stringThe unique ID of the shell call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the shell tool call generated by the model.
-
max_output_length: numberThe maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
-
output: array of object { outcome, stderr, stdout, created_by }An array of shell call output contents
-
outcome: object { type } or object { exit_code, type }Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
-
timeout: object { type }Indicates that the shell call exceeded its configured time limit.
-
exit: object { exit_code, type }Indicates that the shell commands finished and returned an exit code.
-
exit_code: numberExit code from the shell process.
-
type: "exit"The outcome type. Always
exit.
-
-
-
stderr: stringThe standard error output that was captured.
-
stdout: stringThe standard output that was captured.
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of
in_progress,completed, orincomplete.-
"in_progress" -
"completed" -
"incomplete"
-
-
type: "shell_call_output"The type of the shell call output. Always
shell_call_output. -
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_apply_patch_tool_call: object { id, call_id, operation, 3 more }A tool call that applies file diffs by creating, deleting, or updating files.
-
id: stringThe unique ID of the apply patch tool call. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
operation: object { diff, path, type } or object { path, type } or object { diff, path, type }One of the create_file, delete_file, or update_file operations applied via apply_patch.
-
create_file: object { diff, path, type }Instruction describing how to create a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to create.
-
type: "create_file"Create a new file with the provided diff.
-
-
delete_file: object { path, type }Instruction describing how to delete a file via the apply_patch tool.
-
path: stringPath of the file to delete.
-
type: "delete_file"Delete the specified file.
-
-
update_file: object { diff, path, type }Instruction describing how to update a file via the apply_patch tool.
-
diff: stringDiff to apply.
-
path: stringPath of the file to update.
-
type: "update_file"Update an existing file with the provided diff.
-
-
-
status: "in_progress" or "completed"The status of the apply patch tool call. One of
in_progressorcompleted.-
"in_progress" -
"completed"
-
-
type: "apply_patch_call"The type of the item. Always
apply_patch_call. -
created_by: optional stringThe ID of the entity that created this tool call.
-
-
response_apply_patch_tool_call_output: object { id, call_id, status, 3 more }The output emitted by an apply patch tool call.
-
id: stringThe unique ID of the apply patch tool call output. Populated when this item is returned via API.
-
call_id: stringThe unique ID of the apply patch tool call generated by the model.
-
status: "completed" or "failed"The status of the apply patch tool call output. One of
completedorfailed.-
"completed" -
"failed"
-
-
type: "apply_patch_call_output"The type of the item. Always
apply_patch_call_output. -
created_by: optional stringThe ID of the entity that created this tool call output.
-
output: optional stringOptional textual output returned by the apply patch tool.
-
-
mcp_list_tools: object { id, server_label, tools, 2 more }A list of tools available on an MCP server.
-
id: stringThe unique ID of the list.
-
server_label: stringThe label of the MCP server.
-
tools: array of object { input_schema, name, annotations, description }The tools available on the server.
-
input_schema: unknownThe JSON schema describing the tool's input.
-
name: stringThe name of the tool.
-
annotations: optional unknownAdditional annotations about the tool.
-
description: optional stringThe description of the tool.
-
-
type: "mcp_list_tools"The type of the item. Always
mcp_list_tools. -
error: optional stringError message if the server could not list tools.
-
-
mcp_approval_request: object { id, arguments, name, 2 more }A request for human approval of a tool invocation.
-
id: stringThe unique ID of the approval request.
-
arguments: stringA JSON string of arguments for the tool.
-
name: stringThe name of the tool to run.
-
server_label: stringThe label of the MCP server making the request.
-
type: "mcp_approval_request"The type of the item. Always
mcp_approval_request.
-
-
mcp_approval_response: object { id, approval_request_id, approve, 2 more }A response to an MCP approval request.
-
id: stringThe unique ID of the approval response
-
approval_request_id: stringThe ID of the approval request being answered.
-
approve: booleanWhether the request was approved.
-
type: "mcp_approval_response"The type of the item. Always
mcp_approval_response. -
reason: optional stringOptional reason for the decision.
-
-
mcp_call: object { id, arguments, name, 6 more }An invocation of a tool on an MCP server.
-
id: stringThe unique ID of the tool call.
-
arguments: stringA JSON string of the arguments passed to the tool.
-
name: stringThe name of the tool that was run.
-
server_label: stringThe label of the MCP server running the tool.
-
type: "mcp_call"The type of the item. Always
mcp_call. -
approval_request_id: optional stringUnique identifier for the MCP tool call approval request. Include this value in a subsequent
mcp_approval_responseinput to approve or reject the corresponding tool call. -
error: optional stringThe error from the tool call, if any.
-
output: optional stringThe output from the tool call.
-
status: optional "in_progress" or "completed" or "incomplete" or 2 moreThe status of the tool call. One of
in_progress,completed,incomplete,calling, orfailed.-
"in_progress" -
"completed" -
"incomplete" -
"calling" -
"failed"
-
-
-
response_custom_tool_call_item: ResponseCustomToolCallA call to a custom tool created by the model.
-
id: stringThe unique ID of the custom tool call item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
response_custom_tool_call_output_item: ResponseCustomToolCallOutputThe output of a custom tool call from your code, being sent back to the model.
-
id: stringThe unique ID of the custom tool call output item.
-
status: "in_progress" or "completed" or "incomplete"The status of the item. One of
in_progress,completed, orincomplete. Populated when items are returned via API.-
"in_progress" -
"completed" -
"incomplete"
-
-
created_by: optional stringThe identifier of the actor that created the item.
-
-
-
first_id: stringThe ID of the first item in the list.
-
has_more: booleanWhether there are more items available.
-
last_id: stringThe ID of the last item in the list.
-
object: "list"The type of object returned, must be
list.
-
Input Tokens
Get input token counts
$ openai responses:input-tokens count
post /responses/input_tokens
Returns input token counts of the request.
Returns an object with object set to response.input_tokens and an input_tokens count.
Parameters
-
--conversation: optional string or ResponseConversationParamThe conversation that this response belongs to. Items from this conversation are prepended to
input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes. -
--input: optional string or array of ResponseInputItemText, image, or file inputs to the model, used to generate a response
-
--instructions: optional stringA system (or developer) message inserted into the model's context. When used 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. -
--model: optional stringModel ID used to generate the response, like
gpt-4ooro3. 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. -
--parallel-tool-calls: optional booleanWhether to allow the model to run tool calls in parallel.
-
--personality: optional string or "friendly" or "pragmatic"A model-owned style preset to apply to this request. Omit this parameter to use the model's default style. Supported values may expand over time. Values must be at most 64 characters.
-
--previous-response-id: optional stringThe 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. -
--reasoning: optional object { context, effort, generate_summary, summary }gpt-5 and o-series models only Configuration options for reasoning models.
-
--text: optional object { 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 or ToolChoiceTypes or 5 moreControls which tool the model should use, if any.
-
--tool: optional array of ToolAn array of tools the model may call while generating a response. You can specify which tool to use by setting the
tool_choiceparameter. -
--truncation: optional "auto" or "disabled"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. -disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.
Returns
-
InputTokenCountResponse: object { input_tokens, object }-
input_tokens: number -
object: "response.input_tokens"
-
Example
openai responses:input-tokens count \
--api-key 'My API Key'
Response
{
"input_tokens": 123,
"object": "response.input_tokens"
}