List input items
Returns a list of input items for a given response.
Query Parameters
Returns
ResponseItemList object { data, first_id, has_more, 2 more } A list of Response items.
A list of Response items.
data: array of ResponseInputMessageItem { id, content, role, 2 more } or ResponseOutputMessage { id, content, role, 3 more } or FileSearchCall { id, queries, status, 2 more } or 27 moreA list of items used to generate this response.
A list of items used to generate this response.
ResponseInputMessageItem object { id, content, role, 2 more }
A list of one or many input items to the model, containing different content
types.
A list of one or many input items to the model, containing different content types.
ResponseInputText object { text, type, prompt_cache_breakpoint } A text input to the model.
A text input to the model.
ResponseInputImage object { detail, type, file_id, 2 more } An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
ResponseInputFile object { type, detail, file_data, 4 more } A file input to the model.
A file input to the model.
detail: optional "auto" or "low" or "high"The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
ResponseOutputMessage object { id, content, role, 3 more } An output message from the model.
An output message from the model.
content: array of ResponseOutputText { annotations, logprobs, text, type } or ResponseOutputRefusal { refusal, type } The content of the output message.
The content of the output message.
ResponseOutputText object { annotations, logprobs, text, type } A text output from the model.
A text output from the model.
annotations: array of FileCitation { file_id, filename, index, type } or URLCitation { end_index, start_index, title, 2 more } or ContainerFileCitation { container_id, end_index, file_id, 3 more } or FilePath { file_id, index, type } The annotations of the text output.
The annotations of the text output.
URLCitation object { end_index, start_index, title, 2 more } A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
status: "in_progress" or "completed" or "incomplete"The status of the message input. One of in_progress, completed, or
incomplete. Populated when input items are returned via API.
The status of the message input. One of in_progress, completed, or
incomplete. Populated when input items are returned via API.
phase: optional "commentary" or "final_answer" or nullLabels an assistant message as intermediate commentary (commentary) or the final answer (final_answer).
For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend
phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
Labels an assistant message as intermediate commentary (commentary) or the final answer (final_answer).
For models like gpt-5.3-codex and beyond, when sending follow-up requests, preserve and resend
phase on all assistant messages — dropping it can degrade performance. Not used for user messages.
FileSearchCall object { id, queries, status, 2 more } The results of a file search tool call. See the
file search guide for more information.
The results of a file search tool call. See the file search guide for more information.
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the file search tool call. One of in_progress,
searching, incomplete or failed,
The status of the file search tool call. One of in_progress,
searching, incomplete or failed,
results: optional array of object { attributes, file_id, filename, 2 more } or nullThe results of the file search tool call.
The results of the file search tool call.
attributes: optional map[string or number or boolean] or nullSet 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.
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.
ComputerCall 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.
A tool call to a computer use tool. See the computer use guide for more information.
pending_safety_checks: array of object { id, code, message } The pending safety checks for the computer call.
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, or
incomplete. Populated when items are returned via API.
The status of the item. One of in_progress, completed, or
incomplete. Populated when items are returned via API.
The type of the computer call. Always computer_call.
A click action.
A click action.
Click object { button, type, x, 2 more } A click action.
A click action.
DoubleClick object { keys, type, x, y } A double click action.
A double click action.
Drag object { path, type, keys } A drag action.
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 }
]
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 }
]
Scroll object { scroll_x, scroll_y, type, 3 more } A scroll action.
A scroll action.
Flattened batched actions for computer_use. Each action includes an
type discriminator and action-specific fields.
Flattened batched actions for computer_use. Each action includes an
type discriminator and action-specific fields.
Click object { button, type, x, 2 more } A click action.
A click action.
DoubleClick object { keys, type, x, y } A double click action.
A double click action.
Drag object { path, type, keys } A drag action.
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 }
]
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 }
]
Scroll object { scroll_x, scroll_y, type, 3 more } A scroll action.
A scroll action.
ComputerCallOutput object { id, call_id, output, 4 more }
A computer screenshot image used with the computer use tool.
A computer screenshot image used with the computer use tool.
status: "completed" or "incomplete" or "failed" or "in_progress"The status of the message input. One of in_progress, completed, or
incomplete. Populated when input items are returned via API.
The status of the message input. One of in_progress, completed, or
incomplete. Populated when input items are returned via API.
The type of the computer tool call output. Always computer_call_output.
WebSearchCall object { id, status, type, action } The results of a web search tool call. See the
web search guide for more information.
The results of a web search tool call. See the web search guide for more information.
status: "in_progress" or "searching" or "completed" or 2 moreThe status of the web search tool call.
The status of the web search tool call.
action: optional Search { type, queries, query, sources } or OpenPage { type, url } or FindInPage { 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).
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).
FunctionCall object { id, arguments, call_id, 7 more }
FunctionCallOutput object { id, output, status, 6 more }
output: string or array of ResponseInputText { text, type, prompt_cache_breakpoint } or ResponseInputImage { detail, type, file_id, 2 more } or ResponseInputFile { type, detail, file_data, 4 more } The output from the function call generated by your code.
Can be a string or an list of output content.
The output from the function call generated by your code. Can be a string or an list of output content.
OutputContentList = array of ResponseInputText { text, type, prompt_cache_breakpoint } or ResponseInputImage { detail, type, file_id, 2 more } or ResponseInputFile { type, detail, file_data, 4 more } Text, image, or file output of the function call.
Text, image, or file output of the function call.
ResponseInputText object { text, type, prompt_cache_breakpoint } A text input to the model.
A text input to the model.
ResponseInputImage object { detail, type, file_id, 2 more } An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
ResponseInputFile object { type, detail, file_data, 4 more } A file input to the model.
A file input to the model.
detail: optional "auto" or "low" or "high"The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
status: "in_progress" or "completed" or "incomplete"The status of the item. One of in_progress, completed, or
incomplete. Populated when items are returned via API.
The status of the item. One of in_progress, completed, or
incomplete. Populated when items are returned via API.
ToolSearchCall object { id, arguments, call_id, 4 more }
status: "in_progress" or "completed" or "incomplete"The status of the tool search call item that was recorded.
The status of the tool search call item that was recorded.
ToolSearchOutput object { id, call_id, execution, 4 more }
status: "in_progress" or "completed" or "incomplete"The status of the tool search output item that was recorded.
The status of the tool search output item that was recorded.
tools: array of Function { name, parameters, strict, 6 more } or FileSearch { type, vector_store_ids, filters, 2 more } or Computer { type } or 13 moreThe loaded tool definitions returned by tool search.
The loaded tool definitions returned by tool search.
Function object { name, parameters, strict, 6 more } Defines a function in your own code the model can choose to call. Learn more about function calling.
Defines a function in your own code the model can choose to call. Learn more about function calling.
FileSearch 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.
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
A filter to apply.
A filter to apply.
ComparisonFilter object { key, type, value } A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
CompoundFilter object { filters, type } Combine multiple filters using and or or.
Combine multiple filters using and or or.
Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
ComparisonFilter object { key, type, value } A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
The 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.
Ranking options for search.
Computer object { type } A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
ComputerUsePreview object { display_height, display_width, environment, type } A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
WebSearch object { type, external_web_access, filters, 2 more } Search the Internet for sources related to the prompt. Learn more about the
web search tool.
Search the Internet for sources related to the prompt. Learn more about the web search tool.
type: "web_search" or "web_search_2025_08_26" (default: "web_search")The type of the web search tool. One of web_search or web_search_2025_08_26.
The type of the web search tool. One of web_search or web_search_2025_08_26.
Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.
search_context_size: optional "low" or "medium" or "high" (default: "medium")High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
user_location: optional object { city, country, region, 2 more } or nullThe approximate location of the user. If omitted or null, defaults to the
United States. To avoid this fallback, pass {"type": "approximate"} without
location fields. To localize results, provide the relevant location fields.
The approximate location of the user. If omitted or null, defaults to the
United States. To avoid this fallback, pass {"type": "approximate"} without
location fields. To localize results, provide the relevant location fields.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.
Mcp object { server_label, type, allowed_callers, 9 more } Give the model access to additional tools via remote Model Context Protocol
(MCP) servers. Learn more about MCP.
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
allowed_tools: optional array of string or McpToolFilter { read_only, tool_names } or nullList of allowed tool names or a filter object.
List of allowed tool names or a filter object.
McpToolFilter object { read_only, tool_names } A filter object to specify which tools are allowed.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
An 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 moreDeprecated.
Identifier for service connectors, like those available in ChatGPT. One of
server_url, connector_id, or tunnel_id must be provided. Learn more
about service connectors here.
This field is deprecated for models released after September 1, 2026.
Use server_url to connect to a remote MCP server, or tunnel_id to
connect through a Secure MCP Tunnel.
Currently supported connector_id values 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
Deprecated.
Identifier for service connectors, like those available in ChatGPT. One of
server_url, connector_id, or tunnel_id must be provided. Learn more
about service connectors here.
This field is deprecated for models released after September 1, 2026.
Use server_url to connect to a remote MCP server, or tunnel_id to
connect through a Secure MCP Tunnel.
Currently supported connector_id values 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
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
require_approval: optional McpToolApprovalFilter { always, never } or "always" or "never" or null (default: "always")Specify which of the MCP server’s tools require approval.
Specify which of the MCP server’s tools require approval.
McpToolApprovalFilter 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.
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.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
never: optional object { read_only, tool_names } A filter object to specify which tools are allowed.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
Optional description of the MCP server, used to provide more context.
CodeInterpreter object { container, type, allowed_callers } A tool that runs Python code to help generate a response to a prompt.
A tool that runs Python code to help generate a response to a prompt.
container: string or CodeInterpreterToolAuto { 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_limit setting.
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_limit setting.
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.
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
An optional list of uploaded files to make available to your code.
memory_limit: optional "1g" or "4g" or "16g" or "64g" or nullThe memory limit for the code interpreter container.
The memory limit for the code interpreter container.
network_policy: optional ContainerNetworkPolicyDisabled { type } or ContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets } Network access policy for the container.
Network access policy for the container.
ImageGeneration object { type, action, background, 13 more } A tool that generates images using the GPT image models.
A tool that generates images using the GPT image models.
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default: auto.
Whether to generate a new image or edit an existing image. Default: auto.
background: optional "transparent" or "opaque" or "auto" (default: "auto")Set the background of the generated image. One of transparent, opaque,
or auto. gpt-image-2.5-sunburst and gpt-image-2.5-flare, including
their 2026-09-08 snapshots, support opaque and transparent
backgrounds. Transparent backgrounds are available for supported GPT Image
models. For gpt-image-2 and gpt-image-2-2026-04-21, this support is in
preview. When using transparent, set the output format to png or webp.
Default: auto.
Set the background of the generated image. One of transparent, opaque,
or auto. gpt-image-2.5-sunburst and gpt-image-2.5-flare, including
their 2026-09-08 snapshots, support opaque and transparent
backgrounds. Transparent backgrounds are available for supported GPT Image
models. For gpt-image-2 and gpt-image-2-2026-04-21, this support is in
preview. When using transparent, set the output format to png or webp.
Default: auto.
complexity: optional "low" or "medium" or "high"Computation spent planning the image, independently of rendering quality.
Overrides the outer response’s reasoning.effort for image generation.
When omitted, inherits a supported outer reasoning effort or uses the
image model’s configured default.
For SVG output, controls the reference image, not the SVG author’s
reasoning.
Computation spent planning the image, independently of rendering quality.
Overrides the outer response’s reasoning.effort for image generation.
When omitted, inherits a supported outer reasoning effort or uses the
image model’s configured default.
For SVG output, controls the reference image, not the SVG author’s
reasoning.
Number of GIF frames. Requires output_format to be gif. Default: 9.
Duration of each GIF frame in milliseconds, rounded to 10 ms.
Requires output_format to be gif. Default: 200.
input_fidelity: optional "high" or "low" or nullControl how much effort the model will exert to match the style and features, especially facial features, of input images. Supports high and low on gpt-image-1.5; gpt-image-1-mini supports only low. For gpt-image-2, omit this parameter. Defaults to low on supported models.
Control how much effort the model will exert to match the style and features, especially facial features, of input images. Supports high and low on gpt-image-1.5; gpt-image-1-mini supports only low. For gpt-image-2, omit this parameter. Defaults to low on supported models.
input_image_mask: optional object { file_id, image_url } Optional mask for inpainting. Contains image_url
(string, optional) and file_id (string, optional).
Optional mask for inpainting. Contains image_url
(string, optional) and file_id (string, optional).
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 9 moreThe image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
The image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 9 moreThe image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
The image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
moderation: optional "auto" or "low" (default: "auto")Moderation level for the generated image. Default: auto.
Moderation level for the generated image. Default: auto.
Compression level for the output image. Default: 100.
output_format: optional "png" or "webp" or "jpeg" or 2 more (default: "png")The output format of the generated image. One of png, webp, jpeg,
gif, or svg. Default: png. GIF and SVG output require a model
that supports the selected format. GIF output does not support
partial image streaming (partial_images greater than 0),
input_image_mask, or custom output_compression.
Responses lifecycle events can still be streamed for GIF output.
The output format of the generated image. One of png, webp, jpeg,
gif, or svg. Default: png. GIF and SVG output require a model
that supports the selected format. GIF output does not support
partial image streaming (partial_images greater than 0),
input_image_mask, or custom output_compression.
Responses lifecycle events can still be streamed for GIF output.
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
quality: optional "low" or "medium" or "high" or 3 more (default: "auto")The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max.
Default: auto.
The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max.
Default: auto.
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" (default: "auto")The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
"1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
svg: optional object { model, reasoning } SVG author model settings. Requires output_format to be svg.
When SVG model selection is enabled, omitting this object uses the
outer response model. Otherwise, the default SVG author is used and
explicit model overrides are unavailable.
SVG author model settings. Requires output_format to be svg.
When SVG model selection is enabled, omitting this object uses the
outer response model. Otherwise, the default SVG author is used and
explicit model overrides are unavailable.
LocalShell object { type } A tool that allows the model to execute shell commands in a local environment.
A tool that allows the model to execute shell commands in a local environment.
Shell object { type, allowed_callers, environment } A tool that allows the model to execute shell commands.
A tool that allows the model to execute shell commands.
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
environment: optional ContainerAuto { type, file_ids, memory_limit, 2 more } or LocalEnvironment { type, skills } or ContainerReference { container_id, type } or null
ContainerAuto object { type, file_ids, memory_limit, 2 more }
Automatically creates a container for this request
An optional list of uploaded files to make available to your code.
network_policy: optional ContainerNetworkPolicyDisabled { type } or ContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets } Network access policy for the container.
Network access policy for the container.
skills: optional array of SkillReference { skill_id, type, version } or InlineSkill { description, name, source, type } An optional list of skills referenced by id or inline data.
maxItems200
An optional list of skills referenced by id or inline data.
Custom object { name, type, allowed_callers, 4 more } A custom tool that processes input using a specified format. Learn more about custom tools
A custom tool that processes input using a specified format. Learn more about custom tools
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Namespace object { description, name, tools, type } Groups function/custom tools under a shared namespace.
Groups function/custom tools under a shared namespace.
tools: array of Function { name, type, allowed_callers, 6 more } or Custom { name, type, allowed_callers, 4 more } The function/custom tools available inside this namespace.
minItems1
The function/custom tools available inside this namespace.
Function object { name, type, allowed_callers, 6 more }
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Whether this function should be deferred and discovered via tool search.
Custom object { name, type, allowed_callers, 4 more } A custom tool that processes input using a specified format. Learn more about custom tools
A custom tool that processes input using a specified format. Learn more about custom tools
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
ToolSearch object { type, description, execution, parameters } Hosted or BYOT tool search configuration for deferred tools.
Hosted or BYOT tool search configuration for deferred tools.
WebSearchPreview 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.
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" (default: "web_search_preview")The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
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, or high. medium is the default.
High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
user_location: optional object { type, city, country, 2 more } or nullThe approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass {"type": "approximate"} without location fields. To localize results, provide the relevant location fields.
The approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass {"type": "approximate"} without location fields. To localize results, provide the relevant location fields.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.
AdditionalTools object { id, role, tools, type }
tools: array of Function { name, parameters, strict, 6 more } or FileSearch { type, vector_store_ids, filters, 2 more } or Computer { type } or 13 moreThe additional tool definitions made available at this item.
The additional tool definitions made available at this item.
Function object { name, parameters, strict, 6 more } Defines a function in your own code the model can choose to call. Learn more about function calling.
Defines a function in your own code the model can choose to call. Learn more about function calling.
FileSearch 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.
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
A filter to apply.
A filter to apply.
ComparisonFilter object { key, type, value } A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
CompoundFilter object { filters, type } Combine multiple filters using and or or.
Combine multiple filters using and or or.
Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
ComparisonFilter object { key, type, value } A filter used to compare a specified attribute key to a given value using a defined comparison operation.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
The 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.
Ranking options for search.
Computer object { type } A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
ComputerUsePreview object { display_height, display_width, environment, type } A tool that controls a virtual computer. Learn more about the computer tool.
A tool that controls a virtual computer. Learn more about the computer tool.
WebSearch object { type, external_web_access, filters, 2 more } Search the Internet for sources related to the prompt. Learn more about the
web search tool.
Search the Internet for sources related to the prompt. Learn more about the web search tool.
type: "web_search" or "web_search_2025_08_26" (default: "web_search")The type of the web search tool. One of web_search or web_search_2025_08_26.
The type of the web search tool. One of web_search or web_search_2025_08_26.
Allow live internet access for web search. Defaults to true when omitted. When false, the web search tool runs in offline/cache-only mode and will not fetch new external content.
search_context_size: optional "low" or "medium" or "high" (default: "medium")High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
user_location: optional object { city, country, region, 2 more } or nullThe approximate location of the user. If omitted or null, defaults to the
United States. To avoid this fallback, pass {"type": "approximate"} without
location fields. To localize results, provide the relevant location fields.
The approximate location of the user. If omitted or null, defaults to the
United States. To avoid this fallback, pass {"type": "approximate"} without
location fields. To localize results, provide the relevant location fields.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.
Mcp object { server_label, type, allowed_callers, 9 more } Give the model access to additional tools via remote Model Context Protocol
(MCP) servers. Learn more about MCP.
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
allowed_tools: optional array of string or McpToolFilter { read_only, tool_names } or nullList of allowed tool names or a filter object.
List of allowed tool names or a filter object.
McpToolFilter object { read_only, tool_names } A filter object to specify which tools are allowed.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
An 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 moreDeprecated.
Identifier for service connectors, like those available in ChatGPT. One of
server_url, connector_id, or tunnel_id must be provided. Learn more
about service connectors here.
This field is deprecated for models released after September 1, 2026.
Use server_url to connect to a remote MCP server, or tunnel_id to
connect through a Secure MCP Tunnel.
Currently supported connector_id values 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
Deprecated.
Identifier for service connectors, like those available in ChatGPT. One of
server_url, connector_id, or tunnel_id must be provided. Learn more
about service connectors here.
This field is deprecated for models released after September 1, 2026.
Use server_url to connect to a remote MCP server, or tunnel_id to
connect through a Secure MCP Tunnel.
Currently supported connector_id values 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
Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
require_approval: optional McpToolApprovalFilter { always, never } or "always" or "never" or null (default: "always")Specify which of the MCP server’s tools require approval.
Specify which of the MCP server’s tools require approval.
McpToolApprovalFilter 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.
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.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
never: optional object { read_only, tool_names } A filter object to specify which tools are allowed.
A filter object to specify which tools are allowed.
Indicates whether or not a tool modifies data or is read-only. If an
MCP server is annotated with readOnlyHint,
it will match this filter.
Optional description of the MCP server, used to provide more context.
CodeInterpreter object { container, type, allowed_callers } A tool that runs Python code to help generate a response to a prompt.
A tool that runs Python code to help generate a response to a prompt.
container: string or CodeInterpreterToolAuto { 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_limit setting.
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_limit setting.
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.
Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
An optional list of uploaded files to make available to your code.
memory_limit: optional "1g" or "4g" or "16g" or "64g" or nullThe memory limit for the code interpreter container.
The memory limit for the code interpreter container.
network_policy: optional ContainerNetworkPolicyDisabled { type } or ContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets } Network access policy for the container.
Network access policy for the container.
ImageGeneration object { type, action, background, 13 more } A tool that generates images using the GPT image models.
A tool that generates images using the GPT image models.
action: optional "generate" or "edit" or "auto"Whether to generate a new image or edit an existing image. Default: auto.
Whether to generate a new image or edit an existing image. Default: auto.
background: optional "transparent" or "opaque" or "auto" (default: "auto")Set the background of the generated image. One of transparent, opaque,
or auto. gpt-image-2.5-sunburst and gpt-image-2.5-flare, including
their 2026-09-08 snapshots, support opaque and transparent
backgrounds. Transparent backgrounds are available for supported GPT Image
models. For gpt-image-2 and gpt-image-2-2026-04-21, this support is in
preview. When using transparent, set the output format to png or webp.
Default: auto.
Set the background of the generated image. One of transparent, opaque,
or auto. gpt-image-2.5-sunburst and gpt-image-2.5-flare, including
their 2026-09-08 snapshots, support opaque and transparent
backgrounds. Transparent backgrounds are available for supported GPT Image
models. For gpt-image-2 and gpt-image-2-2026-04-21, this support is in
preview. When using transparent, set the output format to png or webp.
Default: auto.
complexity: optional "low" or "medium" or "high"Computation spent planning the image, independently of rendering quality.
Overrides the outer response’s reasoning.effort for image generation.
When omitted, inherits a supported outer reasoning effort or uses the
image model’s configured default.
For SVG output, controls the reference image, not the SVG author’s
reasoning.
Computation spent planning the image, independently of rendering quality.
Overrides the outer response’s reasoning.effort for image generation.
When omitted, inherits a supported outer reasoning effort or uses the
image model’s configured default.
For SVG output, controls the reference image, not the SVG author’s
reasoning.
Number of GIF frames. Requires output_format to be gif. Default: 9.
Duration of each GIF frame in milliseconds, rounded to 10 ms.
Requires output_format to be gif. Default: 200.
input_fidelity: optional "high" or "low" or nullControl how much effort the model will exert to match the style and features, especially facial features, of input images. Supports high and low on gpt-image-1.5; gpt-image-1-mini supports only low. For gpt-image-2, omit this parameter. Defaults to low on supported models.
Control how much effort the model will exert to match the style and features, especially facial features, of input images. Supports high and low on gpt-image-1.5; gpt-image-1-mini supports only low. For gpt-image-2, omit this parameter. Defaults to low on supported models.
input_image_mask: optional object { file_id, image_url } Optional mask for inpainting. Contains image_url
(string, optional) and file_id (string, optional).
Optional mask for inpainting. Contains image_url
(string, optional) and file_id (string, optional).
model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 9 moreThe image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
The image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-2" or 9 moreThe image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
The image generation model to use. One of gpt-image-1-mini,
gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, gpt-image-2.5-sunburst,
gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare,
gpt-image-2.5-flare-2026-09-08, gpt-image-2.6-sunburst,
gpt-image-2.6-flare, or chatgpt-image-latest. Default:
gpt-image-2.
gpt-image-1 was shut down on October 23, 2026. Use
gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
moderation: optional "auto" or "low" (default: "auto")Moderation level for the generated image. Default: auto.
Moderation level for the generated image. Default: auto.
Compression level for the output image. Default: 100.
output_format: optional "png" or "webp" or "jpeg" or 2 more (default: "png")The output format of the generated image. One of png, webp, jpeg,
gif, or svg. Default: png. GIF and SVG output require a model
that supports the selected format. GIF output does not support
partial image streaming (partial_images greater than 0),
input_image_mask, or custom output_compression.
Responses lifecycle events can still be streamed for GIF output.
The output format of the generated image. One of png, webp, jpeg,
gif, or svg. Default: png. GIF and SVG output require a model
that supports the selected format. GIF output does not support
partial image streaming (partial_images greater than 0),
input_image_mask, or custom output_compression.
Responses lifecycle events can still be streamed for GIF output.
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
quality: optional "low" or "medium" or "high" or 3 more (default: "auto")The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max.
Default: auto.
The quality of the generated image. The GPT image models support low,
medium, and high. gpt-image-2.5-sunburst and gpt-image-2.5-flare,
including their 2026-09-08 snapshots, also support xhigh and max.
Default: auto.
size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto" (default: "auto")The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
"1024x1024" or "1024x1536" or "1536x1024" or "auto"The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
The size of the generated images. For gpt-image-2, gpt-image-2-2026-04-21, gpt-image-2.5-sunburst, gpt-image-2.5-sunburst-2026-09-08, gpt-image-2.5-flare, and gpt-image-2.5-flare-2026-09-08, arbitrary resolutions are supported as WIDTHxHEIGHT strings, for example 1536x864. Width and height must both be divisible by 16 and the requested aspect ratio must be between 1:3 and 3:1. Resolutions above 2560x1440 are experimental, and the maximum supported resolution is 3840x2160. The requested size must also satisfy the model’s current pixel and edge limits. The standard sizes 1024x1024, 1536x1024, and 1024x1536 are supported by the GPT image models; auto is supported for models that allow automatic sizing.
svg: optional object { model, reasoning } SVG author model settings. Requires output_format to be svg.
When SVG model selection is enabled, omitting this object uses the
outer response model. Otherwise, the default SVG author is used and
explicit model overrides are unavailable.
SVG author model settings. Requires output_format to be svg.
When SVG model selection is enabled, omitting this object uses the
outer response model. Otherwise, the default SVG author is used and
explicit model overrides are unavailable.
LocalShell object { type } A tool that allows the model to execute shell commands in a local environment.
A tool that allows the model to execute shell commands in a local environment.
Shell object { type, allowed_callers, environment } A tool that allows the model to execute shell commands.
A tool that allows the model to execute shell commands.
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
environment: optional ContainerAuto { type, file_ids, memory_limit, 2 more } or LocalEnvironment { type, skills } or ContainerReference { container_id, type } or null
ContainerAuto object { type, file_ids, memory_limit, 2 more }
Automatically creates a container for this request
An optional list of uploaded files to make available to your code.
network_policy: optional ContainerNetworkPolicyDisabled { type } or ContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets } Network access policy for the container.
Network access policy for the container.
skills: optional array of SkillReference { skill_id, type, version } or InlineSkill { description, name, source, type } An optional list of skills referenced by id or inline data.
maxItems200
An optional list of skills referenced by id or inline data.
Custom object { name, type, allowed_callers, 4 more } A custom tool that processes input using a specified format. Learn more about custom tools
A custom tool that processes input using a specified format. Learn more about custom tools
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Namespace object { description, name, tools, type } Groups function/custom tools under a shared namespace.
Groups function/custom tools under a shared namespace.
tools: array of Function { name, type, allowed_callers, 6 more } or Custom { name, type, allowed_callers, 4 more } The function/custom tools available inside this namespace.
minItems1
The function/custom tools available inside this namespace.
Function object { name, type, allowed_callers, 6 more }
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Whether this function should be deferred and discovered via tool search.
Custom object { name, type, allowed_callers, 4 more } A custom tool that processes input using a specified format. Learn more about custom tools
A custom tool that processes input using a specified format. Learn more about custom tools
allowed_callers: optional array of "direct" or "programmatic" or nullThe tool invocation context(s).
minItems1
The tool invocation context(s).
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
ToolSearch object { type, description, execution, parameters } Hosted or BYOT tool search configuration for deferred tools.
Hosted or BYOT tool search configuration for deferred tools.
WebSearchPreview 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.
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" (default: "web_search_preview")The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
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, or high. medium is the default.
High level guidance for the amount of context window space to use for the search. One of low, medium, or high. medium is the default.
user_location: optional object { type, city, country, 2 more } or nullThe approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass {"type": "approximate"} without location fields. To localize results, provide the relevant location fields.
The approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass {"type": "approximate"} without location fields. To localize results, provide the relevant location fields.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.
ConfigurationUpdate object { id, type, reasoning, text } A configuration update for subsequent responses. Each setting stays in effect
until a later update replaces that setting.
A configuration update for subsequent responses. Each setting stays in effect until a later update replaces that setting.
The item type. Always configuration_update.
reasoning: optional object { effort } The reasoning configuration applied by this update.
The reasoning configuration applied by this update.
text: optional object { format } The text output configuration for subsequent responses.
The text output configuration for subsequent responses.
format: ResponseFormatText { type } or ResponseFormatTextJSONSchemaConfig { name, schema, type, 2 more } Use a JSON schema for structured output or text to return to plain text.
Use a JSON schema for structured output or text to return to plain text.
ResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more } JSON Schema response format. Used to generate structured JSON responses.
Learn more about Structured Outputs.
JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.
The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.
A description of what the response format is for, used by the model to determine how to respond in the format.
Whether to enable strict schema adherence when generating the output.
If set to true, the model will always follow the exact schema defined
in the schema field. Only a subset of JSON Schema is supported when
strict is true. To learn more, read the Structured Outputs
guide.
Reasoning 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 input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
The encrypted content of the reasoning item. This is populated by default
for reasoning items returned by POST /v1/responses and WebSocket
response.create requests.
When streaming, use the completed reasoning item and its
encrypted_content from the response.output_item.done event in
subsequent requests. The encrypted_content in
response.output_item.added may be incomplete. This is especially
important when store is false or when using Zero Data Retention.
ProgramOutput object { id, call_id, result, 2 more }
Compaction object { id, encrypted_content, type, created_by } A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
ImageGenerationCall object { id, result, status, 9 more } An image generation request made by the model.
An image generation request made by the model.
status: "in_progress" or "completed" or "generating" or "failed"The status of the image generation call.
The status of the image generation call.
background: optional "transparent" or "opaque" or "auto" or nullThe background setting used for generation.
The background setting used for generation.
error: optional object { code, message, param, 2 more } Details of a moderation failure, when available.
Details of a moderation failure, when available.
output_format: optional "png" or "webp" or "jpeg" or 2 more or nullThe output format used for generation.
The output format used for generation.
quality: optional "low" or "medium" or "high" or 3 more or nullThe quality of the image generated by the image generation tool call. One of low, medium, high, xhigh, max, or auto.
The quality of the image generated by the image generation tool call. One of low, medium, high, xhigh, max, or auto.
CodeInterpreterCall object { id, code, container_id, 3 more } A tool call to run code.
A tool call to run code.
outputs: array of Logs { logs, type } or Image { type, url } or nullThe outputs generated by the code interpreter, such as logs or images.
Can be null if no outputs are available.
The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
LocalShellCall object { id, action, call_id, 2 more } A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
LocalShellCallOutput object { id, output, type, status } The output of a local shell tool call.
The output of a local shell tool call.
ShellCall object { id, action, call_id, 5 more } A tool call that executes one or more shell commands in a managed environment.
A tool call that executes one or more shell commands in a managed environment.
action: object { commands, max_output_length, timeout_ms } The shell commands and limits that describe how to run the tool call.
The shell commands and limits that describe how to run the tool call.
environment: ResponseLocalEnvironment { type } or ResponseContainerReference { container_id, type } or nullRepresents the use of a local environment to perform shell actions.
Represents the use of a local environment to perform shell actions.
status: "in_progress" or "completed" or "incomplete"The status of the shell call. One of in_progress, completed, or incomplete.
The status of the shell call. One of in_progress, completed, or incomplete.
ShellCallOutput object { id, call_id, max_output_length, 5 more } The output of a shell tool call that was emitted.
The output of a shell tool call that was emitted.
The 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
An array of shell call output contents
status: "in_progress" or "completed" or "incomplete"The status of the shell call output. One of in_progress, completed, or incomplete.
The status of the shell call output. One of in_progress, completed, or incomplete.
The type of the shell call output. Always shell_call_output.
ApplyPatchCall object { id, call_id, operation, 4 more } A tool call that applies file diffs by creating, deleting, or updating files.
A tool call that applies file diffs by creating, deleting, or updating files.
operation: CreateFile { diff, path, type } or DeleteFile { path, type } or UpdateFile { diff, path, type } One of the create_file, delete_file, or update_file operations applied via apply_patch.
One of the create_file, delete_file, or update_file operations applied via apply_patch.
status: "in_progress" or "completed"The status of the apply patch tool call. One of in_progress or completed.
The status of the apply patch tool call. One of in_progress or completed.
The type of the item. Always apply_patch_call.
ApplyPatchCallOutput object { id, call_id, status, 4 more } The output emitted by an apply patch tool call.
The output emitted by an apply patch tool call.
The unique ID of the apply patch tool call output. Populated when this item is returned via API.
status: "completed" or "failed"The status of the apply patch tool call output. One of completed or failed.
The status of the apply patch tool call output. One of completed or failed.
The type of the item. Always apply_patch_call_output.
McpListTools object { id, server_label, tools, 2 more } A list of tools available on an MCP server.
A list of tools available on an MCP server.
McpApprovalRequest object { id, arguments, name, 2 more } A request for human approval of a tool invocation.
A request for human approval of a tool invocation.
McpApprovalResponse object { id, approval_request_id, approve, 2 more } A response to an MCP approval request.
A response to an MCP approval request.
McpCall object { id, arguments, name, 6 more } An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
Unique identifier for the MCP tool call approval request.
Include this value in a subsequent mcp_approval_response input to approve or reject the corresponding tool call.
CustomToolCall object { id, call_id, input, 7 more }
CustomToolCallOutput object { id, call_id, output, 4 more }
output: string or array of ResponseInputText { text, type, prompt_cache_breakpoint } or ResponseInputImage { detail, type, file_id, 2 more } or ResponseInputFile { type, detail, file_data, 4 more } The output from the custom tool call generated by your code.
Can be a string or an list of output content.
The output from the custom tool call generated by your code. Can be a string or an list of output content.
OutputContentList = array of ResponseInputText { text, type, prompt_cache_breakpoint } or ResponseInputImage { detail, type, file_id, 2 more } or ResponseInputFile { type, detail, file_data, 4 more } Text, image, or file output of the custom tool call.
Text, image, or file output of the custom tool call.
ResponseInputText object { text, type, prompt_cache_breakpoint } A text input to the model.
A text input to the model.
ResponseInputImage object { detail, type, file_id, 2 more } An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.
The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.
ResponseInputFile object { type, detail, file_data, 4 more } A file input to the model.
A file input to the model.
detail: optional "auto" or "low" or "high"The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.
status: "in_progress" or "completed" or "incomplete"The status of the item. One of in_progress, completed, or
incomplete. Populated when items are returned via API.
The status of the item. One of in_progress, completed, or
incomplete. Populated when items are returned via API.
The type of the custom tool call output. Always custom_tool_call_output.
List input items
curl https://api.openai.com/v1/responses/resp_abc123/input_items \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY"
{
"object": "list",
"data": [
{
"id": "msg_abc123",
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "Tell me a three sentence bedtime story about a unicorn."
}
]
}
],
"first_id": "msg_abc123",
"last_id": "msg_abc123",
"has_more": false
}
Returns Examples
{
"object": "list",
"data": [
{
"id": "msg_abc123",
"type": "message",
"role": "user",
"content": [
{
"type": "input_text",
"text": "Tell me a three sentence bedtime story about a unicorn."
}
]
}
],
"first_id": "msg_abc123",
"last_id": "msg_abc123",
"has_more": false
}