tools: Array<BetaFunctionTool { name, parameters, strict, 6 more } | BetaFileSearchTool { type, vector_store_ids, filters, 2 more } | BetaComputerTool { type } | 13 more>

The loaded tool definitions returned by the tool search output.

One of the following:
BetaFunctionTool { name, parameters, strict, 6 more }

Defines a function in your own code the model can choose to call. Learn more about function calling.

name: string

The name of the function to call.

parameters: Record<string, unknown> | null

A JSON schema object describing the parameters of the function.

strict: boolean | null

Whether strict parameter validation is enforced for this function tool.

type: "function"

The type of the function tool. Always function.

allowed_callers?: Array<"direct" | "programmatic"> | null

The tool invocation context(s).

One of the following:
"direct"
"programmatic"
async?: boolean
defer_loading?: boolean

Whether this function is deferred and loaded via tool search.

description?: string | null

A description of the function. Used by the model to determine whether or not to call the function.

output_schema?: Record<string, unknown> | null

A JSON schema object describing the JSON value encoded in string outputs for this function.

BetaFileSearchTool { type, vector_store_ids, filters, 2 more }

A tool that searches for relevant content from uploaded files. Learn more about the file search tool.

type: "file_search"

The type of the file search tool. Always file_search.

vector_store_ids: Array<string>

The IDs of the vector stores to search.

filters?: ComparisonFilter { key, type, value } | CompoundFilter { filters, type } | null

A filter to apply.

One of the following:
ComparisonFilter { key, type, value }

A filter used to compare a specified attribute key to a given value using a defined comparison operation.

key: string

The key to compare against the value.

type: "eq" | "ne" | "gt" | 5 more

Specifies 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
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
"in"
"nin"
value: string | number | boolean | Array<string | number>

The value to compare against the attribute key; supports string, number, or boolean types.

One of the following:
string
number
boolean
Array<string | number>
string
number
CompoundFilter { filters, type }

Combine multiple filters using and or or.

filters: Array<ComparisonFilter { key, type, value } | unknown>

Array of filters to combine. Items can be ComparisonFilter or CompoundFilter.

One of the following:
ComparisonFilter { key, type, value }

A filter used to compare a specified attribute key to a given value using a defined comparison operation.

key: string

The key to compare against the value.

type: "eq" | "ne" | "gt" | 5 more

Specifies 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
One of the following:
"eq"
"ne"
"gt"
"gte"
"lt"
"lte"
"in"
"nin"
value: string | number | boolean | Array<string | number>

The value to compare against the attribute key; supports string, number, or boolean types.

One of the following:
string
number
boolean
Array<string | number>
string
number
unknown
type: "and" | "or"

Type of operation: and or or.

One of the following:
"and"
"or"
max_num_results?: number

The maximum number of results to return. This number should be between 1 and 50 inclusive.

ranking_options?: RankingOptions { hybrid_search, ranker, score_threshold }

Ranking options for search.

ranker?: "auto" | "default-2024-11-15"

The ranker to use for the file search.

One of the following:
"auto"
"default-2024-11-15"
score_threshold?: number

The 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.

BetaComputerTool { type }

A tool that controls a virtual computer. Learn more about the computer tool.

type: "computer"

The type of the computer tool. Always computer.

BetaComputerUsePreviewTool { display_height, display_width, environment, type }

A tool that controls a virtual computer. Learn more about the computer tool.

display_height: number

The height of the computer display.

display_width: number

The width of the computer display.

environment: "windows" | "mac" | "linux" | 2 more

The type of computer environment to control.

One of the following:
"windows"
"mac"
"linux"
"ubuntu"
"browser"
type: "computer_use_preview"

The type of the computer use tool. Always computer_use_preview.

BetaWebSearchTool { type, external_web_access, filters, 2 more }

Search the Internet for sources related to the prompt. Learn more about the web search tool.

type: "web_search" | "web_search_2025_08_26"

The type of the web search tool. One of web_search or web_search_2025_08_26.

One of the following:
"web_search"
"web_search_2025_08_26"
external_web_access?: boolean

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.

filters?: Filters | null

Filters for the search.

allowed_domains?: Array<string> | null

Allowed 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?: "low" | "medium" | "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.

One of the following:
"low"
"medium"
"high"
user_location?: UserLocation | null

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.

city?: string | null

Free text input for the city of the user, e.g. San Francisco.

country?: string | null

The two-letter ISO country code of the user, e.g. US.

region?: string | null

Free text input for the region of the user, e.g. California.

timezone?: string | null

The IANA timezone of the user, e.g. America/Los_Angeles.

type?: "approximate"

The type of location approximation. Always approximate.

Mcp { 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.

server_label: string

A label for this MCP server, used to identify it in tool calls.

type: "mcp"

The type of the MCP tool. Always mcp.

allowed_callers?: Array<"direct" | "programmatic"> | null

The tool invocation context(s).

minItems1
One of the following:
"direct"
"programmatic"
allowed_tools?: Array<string> | McpToolFilter { read_only, tool_names } | null

List of allowed tool names or a filter object.

One of the following:
Array<string>
McpToolFilter { read_only, tool_names }

A filter object to specify which tools are allowed.

read_only?: boolean

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.

tool_names?: Array<string>

List of allowed tool names.

authorization?: string

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?: "connector_dropbox" | "connector_gmail" | "connector_googlecalendar" | 5 more

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
One of the following:
"connector_dropbox"
"connector_gmail"
"connector_googlecalendar"
"connector_googledrive"
"connector_microsoftteams"
"connector_outlookcalendar"
"connector_outlookemail"
"connector_sharepoint"
defer_loading?: boolean

Whether this MCP tool is deferred and discovered via tool search.

headers?: Record<string, string> | null

Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.

require_approval?: McpToolApprovalFilter { always, never } | "always" | "never" | null

Specify which of the MCP server’s tools require approval.

One of the following:
McpToolApprovalFilter { 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?: Always { read_only, tool_names }

A filter object to specify which tools are allowed.

read_only?: boolean

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.

tool_names?: Array<string>

List of allowed tool names.

never?: Never { read_only, tool_names }

A filter object to specify which tools are allowed.

read_only?: boolean

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.

tool_names?: Array<string>

List of allowed tool names.

"always" | "never"
"always"
"never"
server_description?: string

Optional description of the MCP server, used to provide more context.

server_url?: string

The URL for the MCP server. One of server_url, connector_id, or tunnel_id must be provided.

formaturi
tunnel_id?: string

The Secure MCP Tunnel ID to use instead of a direct server URL. One of server_url, connector_id, or tunnel_id must be provided.

CodeInterpreter { container, type, allowed_callers }

A tool that runs Python code to help generate a response to a prompt.

container: string | 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.

One of the following:
string
CodeInterpreterToolAuto { 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?: Array<string>

An optional list of uploaded files to make available to your code.

maxItems50
memory_limit?: "1g" | "4g" | "16g" | "64g" | null

The memory limit for the code interpreter container.

One of the following:
"1g"
"4g"
"16g"
"64g"
network_policy?: BetaContainerNetworkPolicyDisabled { type } | BetaContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets }

Network access policy for the container.

One of the following:
BetaContainerNetworkPolicyDisabled { type }
type: "disabled"

Disable outbound network access. Always disabled.

BetaContainerNetworkPolicyAllowlist { allowed_domains, type, domain_secrets }
allowed_domains: Array<string>

A list of allowed domains when type is allowlist.

minItems1
type: "allowlist"

Allow outbound network access only to specified domains. Always allowlist.

domain_secrets?: Array<BetaContainerNetworkPolicyDomainSecret { domain, name, value } >

Optional domain-scoped secrets for allowlisted domains.

minItems1
domain: string

The domain associated with the secret.

minLength1
name: string

The name of the secret to inject for the domain.

minLength1
value: string

The secret value to inject for the domain.

minLength1
maxLength10485760
type: "code_interpreter"

The type of the code interpreter tool. Always code_interpreter.

allowed_callers?: Array<"direct" | "programmatic"> | null

The tool invocation context(s).

minItems1
One of the following:
"direct"
"programmatic"
ProgrammaticToolCalling { type }
type: "programmatic_tool_calling"

The type of the tool. Always programmatic_tool_calling.

ImageGeneration { type, action, background, 13 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?: "generate" | "edit" | "auto"

Whether to generate a new image or edit an existing image. Default: auto.

One of the following:
"generate"
"edit"
"auto"
background?: "transparent" | "opaque" | "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.

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.

One of the following:
"transparent"
"opaque"
"auto"
complexity?: "low" | "medium" | "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.

One of the following:
"low"
"medium"
"high"
frame_count?: number

Number of GIF frames. Requires output_format to be gif. Default: 9.

minimum2
maximum16
frame_duration_ms?: number

Duration of each GIF frame in milliseconds, rounded to 10 ms. Requires output_format to be gif. Default: 200.

minimum20
maximum2000
input_fidelity?: "high" | "low" | null

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.

One of the following:
"high"
"low"
input_image_mask?: InputImageMask { file_id, image_url }

Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

file_id?: string

File ID for the mask image.

image_url?: string

Base64-encoded mask image.

model?: (string & {}) | "gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 9 more

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.

Deprecated values:

  • “gpt-image-1”: GPT Image 1 was shut down on October 23, 2026. Use gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.
One of the following:
(string & {})
This type repeats the enclosing schema.
"gpt-image-1" | "gpt-image-1-mini" | "gpt-image-2" | 9 more

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-mini"
"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"
"gpt-image-1.5"
"chatgpt-image-latest"
"gpt-image-1"

Deprecated. GPT Image 1 was shut down on October 23, 2026. Use gpt-image-2.5-sunburst or gpt-image-2.5-flare instead.

moderation?: "auto" | "low"

Moderation level for the generated image. Default: auto.

One of the following:
"auto"
"low"
output_compression?: number

Compression level for the output image. Default: 100.

minimum0
maximum100
output_format?: "png" | "webp" | "jpeg" | 2 more

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.

One of the following:
"png"
"webp"
"jpeg"
"gif"
"svg"
partial_images?: number

Number of partial images to generate in streaming mode, from 0 (default value) to 3.

minimum0
maximum3
quality?: "low" | "medium" | "high" | 3 more

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.

One of the following:
"low"
"medium"
"high"
"xhigh"
"max"
"auto"
size?: (string & {}) | "1024x1024" | "1024x1536" | "1536x1024" | "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.

One of the following:
(string & {})
This type repeats the enclosing schema.
"1024x1024" | "1024x1536" | "1536x1024" | "auto"
"1024x1024"
"1024x1536"
"1536x1024"
"auto"
svg?: Svg { 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.

model?: string
minLength1
reasoning?: Reasoning | null

Reasoning effort for SVG authoring. When omitted, uses the author model’s default in both Images and Responses.

effort?: "none" | "minimal" | "low" | 4 more

Controls how much effort the model should spend on reasoning for this request.

LocalShell { type }

A tool that allows the model to execute shell commands in a local environment.

BetaFunctionShellTool { type, allowed_callers, environment }

A tool that allows the model to execute shell commands.

BetaCustomTool { name, type, allowed_callers, 4 more }

A custom tool that processes input using a specified format. Learn more about custom tools

BetaToolSearchOutputNamespaceTool { description, name, tools, type }

Groups function/custom tools under a shared namespace.

BetaToolSearchTool { type, description, execution, parameters }

Hosted or BYOT tool search configuration for deferred tools.

BetaWebSearchPreviewTool { type, search_content_types, search_context_size, user_location }

This tool searches the web for relevant results to use in a response. Learn more about the web search tool.

BetaApplyPatchTool { type, allowed_callers }

Allows the assistant to create, delete, or update files using unified diffs.

type: "tool_search_output"

The item type. Always tool_search_output.

id?: string | null

The unique ID of this tool search output.

agent?: Agent | null

The agent that produced this item.

call_id?: string | null

The unique ID of the tool search call generated by the model.

minLength1
maxLength64
execution?: "server" | "client"

Whether tool search was executed by the server or by the client.

status?: "in_progress" | "completed" | "incomplete" | null

The status of the tool search output.