Defines a function in your own code the model can choose to call. Learn more about function calling.
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
A filter to apply.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
eq: equalsne: not equalgt: greater thangte: greater than or equallt: less thanlte: less than or equalin: innin: not inCombine multiple filters using and or or.
Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.
A filter used to compare a specified attribute key to a given value using a defined comparison operation.
Specifies the comparison operator: eq, ne, gt, gte, lt, lte, in, nin.
eq: equalsne: not equalgt: greater thangte: greater than or equallt: less thanlte: less than or equalin: innin: not inThe maximum number of results to return. This number should be between 1 and 50 inclusive.
Ranking options for search.
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.
Search the Internet for sources related to the prompt. Learn more about the web search tool.
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.
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.
The approximate location of the user.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
List of allowed tool names or a filter object.
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.
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.
Currently supported connector_id values are:
connector_dropboxconnector_gmailconnector_googlecalendarconnector_googledriveconnector_microsoftteamsconnector_outlookcalendarconnector_outlookemailconnector_sharepointOptional HTTP headers to send to the MCP server. Use for authentication or other purposes.
Specify which of the MCP server’s tools 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.
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.
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.
A tool that runs Python code to help generate a response to a prompt.
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.
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.
The memory limit for the code interpreter container.
Network access policy for the container.
A tool that generates images using the GPT image models.
Whether to generate a new image or edit an existing image. Default: auto.
Allows to set transparency for the background of the generated image(s).
Must be one of transparent, opaque, or auto (default value). When
auto is used, the model will automatically determine the best
background for the image.
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.
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-1 and gpt-image-1.5 and later models, unsupported for gpt-image-1-mini. Supports high and low. Defaults to low.
Optional mask for inpainting. Contains image_url
(string, optional) and file_id (string, optional).
The image generation model to use. One of gpt-image-1,
gpt-image-1-mini, gpt-image-1.5, gpt-image-2,
gpt-image-2-2026-04-21, or chatgpt-image-latest. Default:
gpt-image-1.
The output format of the generated image. One of png, webp, or
jpeg. Default: png.
Number of partial images to generate in streaming mode, from 0 (default value) to 3.
The quality of the generated image. One of low, medium, high,
or auto. Default: auto.
The size of the generated images. For gpt-image-2 and gpt-image-2-2026-04-21, 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. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.
A tool that allows the model to execute shell commands in a local environment.
A tool that allows the model to execute shell commands.
An optional list of uploaded files to make available to your code.
Network access policy for the container.
An optional list of skills referenced by id or inline data.
A custom tool that processes input using a specified format. Learn more about custom tools
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Groups function/custom tools under a shared namespace.
The function/custom tools available inside this namespace.
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.
A custom tool that processes input using a specified format. Learn more about custom tools
Whether the tool response can be returned asynchronously versus immediately returned on next response creation.
Hosted or BYOT tool search configuration for deferred tools.
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.
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.
The user’s location.
The two-letter ISO country code of the user, e.g. US.
The IANA timezone of the user, e.g. America/Los_Angeles.