One of the following:
type BetaFunctionTool struct{…}

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 map[string, any]

A JSON schema object describing the parameters of the function.

Strict bool

Whether strict parameter validation is enforced for this function tool.

Type Function

The type of the function tool. Always function.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaFunctionToolAllowedCallerDirect BetaFunctionToolAllowedCaller = "direct"
const BetaFunctionToolAllowedCallerProgrammatic BetaFunctionToolAllowedCaller = "programmatic"
Async boolOptional
DeferLoading boolOptional

Whether this function is deferred and loaded via tool search.

Description stringOptional

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

OutputSchema map[string, any]Optional

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

type BetaFileSearchTool struct{…}

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

Type FileSearch

The type of the file search tool. Always file_search.

VectorStoreIDs []string

The IDs of the vector stores to search.

Filters BetaFileSearchToolFiltersUnionOptional

A filter to apply.

One of the following:
type BetaFileSearchToolFiltersComparisonFilter struct{…}

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 string

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:
const BetaFileSearchToolFiltersComparisonFilterTypeEq BetaFileSearchToolFiltersComparisonFilterType = "eq"
const BetaFileSearchToolFiltersComparisonFilterTypeNe BetaFileSearchToolFiltersComparisonFilterType = "ne"
const BetaFileSearchToolFiltersComparisonFilterTypeGt BetaFileSearchToolFiltersComparisonFilterType = "gt"
const BetaFileSearchToolFiltersComparisonFilterTypeGte BetaFileSearchToolFiltersComparisonFilterType = "gte"
const BetaFileSearchToolFiltersComparisonFilterTypeLt BetaFileSearchToolFiltersComparisonFilterType = "lt"
const BetaFileSearchToolFiltersComparisonFilterTypeLte BetaFileSearchToolFiltersComparisonFilterType = "lte"
const BetaFileSearchToolFiltersComparisonFilterTypeIn BetaFileSearchToolFiltersComparisonFilterType = "in"
const BetaFileSearchToolFiltersComparisonFilterTypeNin BetaFileSearchToolFiltersComparisonFilterType = "nin"
Value BetaFileSearchToolFiltersComparisonFilterValueUnion

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

One of the following:
string
float64
bool
type BetaFileSearchToolFiltersComparisonFilterValueArray []BetaFileSearchToolFiltersComparisonFilterValueArrayItemUnion
One of the following:
string
float64
type BetaFileSearchToolFiltersCompoundFilter struct{…}

Combine multiple filters using and or or.

Filters []BetaFileSearchToolFiltersCompoundFilterFilterUnion

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

One of the following:
type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}

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 string

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:
const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"
Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion

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

One of the following:
string
float64
bool
type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion
One of the following:
string
float64
type BetaFileSearchToolFiltersCompoundFilter struct{…}

Combine multiple filters using and or or.

Filters []BetaFileSearchToolFiltersCompoundFilterFilterUnion

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

One of the following:
type BetaFileSearchToolFiltersCompoundFilterFilter struct{…}

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 string

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:
const BetaFileSearchToolFiltersCompoundFilterFilterTypeEq BetaFileSearchToolFiltersCompoundFilterFilterType = "eq"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeNe BetaFileSearchToolFiltersCompoundFilterFilterType = "ne"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeGt BetaFileSearchToolFiltersCompoundFilterFilterType = "gt"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeGte BetaFileSearchToolFiltersCompoundFilterFilterType = "gte"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeLt BetaFileSearchToolFiltersCompoundFilterFilterType = "lt"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeLte BetaFileSearchToolFiltersCompoundFilterFilterType = "lte"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeIn BetaFileSearchToolFiltersCompoundFilterFilterType = "in"
const BetaFileSearchToolFiltersCompoundFilterFilterTypeNin BetaFileSearchToolFiltersCompoundFilterFilterType = "nin"
Value BetaFileSearchToolFiltersCompoundFilterFilterValueUnion

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

One of the following:
string
float64
bool
type BetaFileSearchToolFiltersCompoundFilterFilterValueArray []BetaFileSearchToolFiltersCompoundFilterFilterValueArrayItemUnion
One of the following:
string
float64
BetaFileSearchToolFiltersCompoundFilter
Type string

Type of operation: and or or.

One of the following:
const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"
const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"
Type string

Type of operation: and or or.

One of the following:
const BetaFileSearchToolFiltersCompoundFilterTypeAnd BetaFileSearchToolFiltersCompoundFilterType = "and"
const BetaFileSearchToolFiltersCompoundFilterTypeOr BetaFileSearchToolFiltersCompoundFilterType = "or"
MaxNumResults int64Optional

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

RankingOptions BetaFileSearchToolRankingOptionsOptional

Ranking options for search.

Ranker stringOptional

The ranker to use for the file search.

One of the following:
const BetaFileSearchToolRankingOptionsRankerAuto BetaFileSearchToolRankingOptionsRanker = "auto"
const BetaFileSearchToolRankingOptionsRankerDefault2024_11_15 BetaFileSearchToolRankingOptionsRanker = "default-2024-11-15"
ScoreThreshold float64Optional

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.

type BetaComputerTool struct{…}

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

Type Computer

The type of the computer tool. Always computer.

type BetaComputerUsePreviewTool struct{…}

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

DisplayHeight int64

The height of the computer display.

DisplayWidth int64

The width of the computer display.

Environment BetaComputerUsePreviewToolEnvironment

The type of computer environment to control.

One of the following:
const BetaComputerUsePreviewToolEnvironmentWindows BetaComputerUsePreviewToolEnvironment = "windows"
const BetaComputerUsePreviewToolEnvironmentMac BetaComputerUsePreviewToolEnvironment = "mac"
const BetaComputerUsePreviewToolEnvironmentLinux BetaComputerUsePreviewToolEnvironment = "linux"
const BetaComputerUsePreviewToolEnvironmentUbuntu BetaComputerUsePreviewToolEnvironment = "ubuntu"
const BetaComputerUsePreviewToolEnvironmentBrowser BetaComputerUsePreviewToolEnvironment = "browser"
Type ComputerUsePreview

The type of the computer use tool. Always computer_use_preview.

type BetaWebSearchTool struct{…}

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

Type BetaWebSearchToolType

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

One of the following:
const BetaWebSearchToolTypeWebSearch BetaWebSearchToolType = "web_search"
const BetaWebSearchToolTypeWebSearch2025_08_26 BetaWebSearchToolType = "web_search_2025_08_26"
ExternalWebAccess boolOptional

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 BetaWebSearchToolFiltersOptional

Filters for the search.

AllowedDomains []stringOptional

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"]

SearchContextSize BetaWebSearchToolSearchContextSizeOptional

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:
const BetaWebSearchToolSearchContextSizeLow BetaWebSearchToolSearchContextSize = "low"
const BetaWebSearchToolSearchContextSizeMedium BetaWebSearchToolSearchContextSize = "medium"
const BetaWebSearchToolSearchContextSizeHigh BetaWebSearchToolSearchContextSize = "high"
UserLocation BetaWebSearchToolUserLocationOptional

The approximate location of the user.

City stringOptional

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

Country stringOptional

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

Region stringOptional

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

Timezone stringOptional

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

Type stringOptional

The type of location approximation. Always approximate.

type BetaToolMcp struct{…}

Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.

ServerLabel string

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

Type Mcp

The type of the MCP tool. Always mcp.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaToolMcpAllowedCallerDirect BetaToolMcpAllowedCaller = "direct"
const BetaToolMcpAllowedCallerProgrammatic BetaToolMcpAllowedCaller = "programmatic"
AllowedTools BetaToolMcpAllowedToolsUnionOptional

List of allowed tool names or a filter object.

One of the following:
type BetaToolMcpAllowedToolsMcpAllowedTools []string

A string array of allowed tool names

type BetaToolMcpAllowedToolsMcpToolFilter struct{…}

A filter object to specify which tools are allowed.

ReadOnly boolOptional

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.

ToolNames []stringOptional

List of allowed tool names.

Authorization stringOptional

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.

ConnectorID stringOptional

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:

  • 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:
const BetaToolMcpConnectorIDConnectorDropbox BetaToolMcpConnectorID = "connector_dropbox"
const BetaToolMcpConnectorIDConnectorGmail BetaToolMcpConnectorID = "connector_gmail"
const BetaToolMcpConnectorIDConnectorGooglecalendar BetaToolMcpConnectorID = "connector_googlecalendar"
const BetaToolMcpConnectorIDConnectorGoogledrive BetaToolMcpConnectorID = "connector_googledrive"
const BetaToolMcpConnectorIDConnectorMicrosoftteams BetaToolMcpConnectorID = "connector_microsoftteams"
const BetaToolMcpConnectorIDConnectorOutlookcalendar BetaToolMcpConnectorID = "connector_outlookcalendar"
const BetaToolMcpConnectorIDConnectorOutlookemail BetaToolMcpConnectorID = "connector_outlookemail"
const BetaToolMcpConnectorIDConnectorSharepoint BetaToolMcpConnectorID = "connector_sharepoint"
DeferLoading boolOptional

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

Headers map[string, string]Optional

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

RequireApproval BetaToolMcpRequireApprovalUnionOptional

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

One of the following:
type BetaToolMcpRequireApprovalMcpToolApprovalFilter struct{…}

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 BetaToolMcpRequireApprovalMcpToolApprovalFilterAlwaysOptional

A filter object to specify which tools are allowed.

ReadOnly boolOptional

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.

ToolNames []stringOptional

List of allowed tool names.

Never BetaToolMcpRequireApprovalMcpToolApprovalFilterNeverOptional

A filter object to specify which tools are allowed.

ReadOnly boolOptional

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.

ToolNames []stringOptional

List of allowed tool names.

type BetaToolMcpRequireApprovalMcpToolApprovalSetting string

Specify a single approval policy for all tools. One of always or never. When set to always, all tools will require approval. When set to never, all tools will not require approval.

One of the following:
const BetaToolMcpRequireApprovalMcpToolApprovalSettingAlways BetaToolMcpRequireApprovalMcpToolApprovalSetting = "always"
const BetaToolMcpRequireApprovalMcpToolApprovalSettingNever BetaToolMcpRequireApprovalMcpToolApprovalSetting = "never"
ServerDescription stringOptional

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

ServerURL stringOptional

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

formaturi
TunnelID stringOptional

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.

type BetaToolCodeInterpreter struct{…}

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

Container BetaToolCodeInterpreterContainerUnion

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
type BetaToolCodeInterpreterContainerCodeInterpreterToolAuto struct{…}

Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.

Type Auto

Always auto.

FileIDs []stringOptional

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

MemoryLimit stringOptional

The memory limit for the code interpreter container.

One of the following:
const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit1g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "1g"
const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit4g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "4g"
const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit16g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "16g"
const BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit64g BetaToolCodeInterpreterContainerCodeInterpreterToolAutoMemoryLimit = "64g"
NetworkPolicy BetaToolCodeInterpreterContainerCodeInterpreterToolAutoNetworkPolicyUnionOptional

Network access policy for the container.

One of the following:
type BetaContainerNetworkPolicyDisabled struct{…}
Type Disabled

Disable outbound network access. Always disabled.

type BetaContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string

A list of allowed domains when type is allowlist.

Type Allowlist

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

Optional domain-scoped secrets for allowlisted domains.

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 CodeInterpreter

The type of the code interpreter tool. Always code_interpreter.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaToolCodeInterpreterAllowedCallerDirect BetaToolCodeInterpreterAllowedCaller = "direct"
const BetaToolCodeInterpreterAllowedCallerProgrammatic BetaToolCodeInterpreterAllowedCaller = "programmatic"
type BetaToolProgrammaticToolCalling struct{…}
Type ProgrammaticToolCalling

The type of the tool. Always programmatic_tool_calling.

type BetaToolImageGeneration struct{…}

A tool that generates images using the GPT image models.

Type ImageGeneration

The type of the image generation tool. Always image_generation.

Action stringOptional

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

One of the following:
const BetaToolImageGenerationActionGenerate BetaToolImageGenerationAction = "generate"
const BetaToolImageGenerationActionEdit BetaToolImageGenerationAction = "edit"
const BetaToolImageGenerationActionAuto BetaToolImageGenerationAction = "auto"
Background stringOptional

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:
const BetaToolImageGenerationBackgroundTransparent BetaToolImageGenerationBackground = "transparent"
const BetaToolImageGenerationBackgroundOpaque BetaToolImageGenerationBackground = "opaque"
const BetaToolImageGenerationBackgroundAuto BetaToolImageGenerationBackground = "auto"
InputFidelity stringOptional

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.

One of the following:
const BetaToolImageGenerationInputFidelityHigh BetaToolImageGenerationInputFidelity = "high"
const BetaToolImageGenerationInputFidelityLow BetaToolImageGenerationInputFidelity = "low"
InputImageMask BetaToolImageGenerationInputImageMaskOptional

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

FileID stringOptional

File ID for the mask image.

ImageURL stringOptional

Base64-encoded mask image.

Model stringOptional

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, 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, or chatgpt-image-latest. Default: gpt-image-1.

One of the following:
string
string
One of the following:
const BetaToolImageGenerationModelGPTImage1 BetaToolImageGenerationModel = "gpt-image-1"
const BetaToolImageGenerationModelGPTImage1Mini BetaToolImageGenerationModel = "gpt-image-1-mini"
const BetaToolImageGenerationModelGPTImage2 BetaToolImageGenerationModel = "gpt-image-2"
const BetaToolImageGenerationModelGPTImage2_2026_04_21 BetaToolImageGenerationModel = "gpt-image-2-2026-04-21"
const BetaToolImageGenerationModelGPTImage2_5Sunburst BetaToolImageGenerationModel = "gpt-image-2.5-sunburst"
const BetaToolImageGenerationModelGPTImage2_5Sunburst2026_09_08 BetaToolImageGenerationModel = "gpt-image-2.5-sunburst-2026-09-08"
const BetaToolImageGenerationModelGPTImage2_5Flare BetaToolImageGenerationModel = "gpt-image-2.5-flare"
const BetaToolImageGenerationModelGPTImage2_5Flare2026_09_08 BetaToolImageGenerationModel = "gpt-image-2.5-flare-2026-09-08"
const BetaToolImageGenerationModelGPTImage1_5 BetaToolImageGenerationModel = "gpt-image-1.5"
const BetaToolImageGenerationModelChatgptImageLatest BetaToolImageGenerationModel = "chatgpt-image-latest"
Moderation stringOptional

Moderation level for the generated image. Default: auto.

One of the following:
const BetaToolImageGenerationModerationAuto BetaToolImageGenerationModeration = "auto"
const BetaToolImageGenerationModerationLow BetaToolImageGenerationModeration = "low"
OutputCompression int64Optional

Compression level for the output image. Default: 100.

minimum0
maximum100
OutputFormat stringOptional

The output format of the generated image. One of png, webp, or jpeg. Default: png.

One of the following:
const BetaToolImageGenerationOutputFormatPNG BetaToolImageGenerationOutputFormat = "png"
const BetaToolImageGenerationOutputFormatWebP BetaToolImageGenerationOutputFormat = "webp"
const BetaToolImageGenerationOutputFormatJPEG BetaToolImageGenerationOutputFormat = "jpeg"
PartialImages int64Optional

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

minimum0
maximum3
Quality stringOptional

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:
const BetaToolImageGenerationQualityLow BetaToolImageGenerationQuality = "low"
const BetaToolImageGenerationQualityMedium BetaToolImageGenerationQuality = "medium"
const BetaToolImageGenerationQualityHigh BetaToolImageGenerationQuality = "high"
const BetaToolImageGenerationQualityXhigh BetaToolImageGenerationQuality = "xhigh"
const BetaToolImageGenerationQualityMax BetaToolImageGenerationQuality = "max"
const BetaToolImageGenerationQualityAuto BetaToolImageGenerationQuality = "auto"
Size stringOptional

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. For dall-e-2, use one of 256x256, 512x512, or 1024x1024. For dall-e-3, use one of 1024x1024, 1792x1024, or 1024x1792.

One of the following:
string
string
One of the following:
const BetaToolImageGenerationSize1024x1024 BetaToolImageGenerationSize = "1024x1024"
const BetaToolImageGenerationSize1024x1536 BetaToolImageGenerationSize = "1024x1536"
const BetaToolImageGenerationSize1536x1024 BetaToolImageGenerationSize = "1536x1024"
const BetaToolImageGenerationSizeAuto BetaToolImageGenerationSize = "auto"
type BetaToolLocalShell struct{…}

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

Type LocalShell

The type of the local shell tool. Always local_shell.

type BetaFunctionShellTool struct{…}

A tool that allows the model to execute shell commands.

Type Shell

The type of the shell tool. Always shell.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaFunctionShellToolAllowedCallerDirect BetaFunctionShellToolAllowedCaller = "direct"
const BetaFunctionShellToolAllowedCallerProgrammatic BetaFunctionShellToolAllowedCaller = "programmatic"
Environment BetaFunctionShellToolEnvironmentUnionOptional
One of the following:
type BetaContainerAuto struct{…}
Type ContainerAuto

Automatically creates a container for this request

FileIDs []stringOptional

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

MemoryLimit BetaContainerAutoMemoryLimitOptional

The memory limit for the container.

One of the following:
const BetaContainerAutoMemoryLimit1g BetaContainerAutoMemoryLimit = "1g"
const BetaContainerAutoMemoryLimit4g BetaContainerAutoMemoryLimit = "4g"
const BetaContainerAutoMemoryLimit16g BetaContainerAutoMemoryLimit = "16g"
const BetaContainerAutoMemoryLimit64g BetaContainerAutoMemoryLimit = "64g"
NetworkPolicy BetaContainerAutoNetworkPolicyUnionOptional

Network access policy for the container.

One of the following:
type BetaContainerNetworkPolicyDisabled struct{…}
Type Disabled

Disable outbound network access. Always disabled.

type BetaContainerNetworkPolicyAllowlist struct{…}
AllowedDomains []string

A list of allowed domains when type is allowlist.

Type Allowlist

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

Optional domain-scoped secrets for allowlisted domains.

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
Skills []BetaContainerAutoSkillUnionOptional

An optional list of skills referenced by id or inline data.

One of the following:
type BetaSkillReference struct{…}
SkillID string

The ID of the referenced skill.

minLength1
maxLength64
Type SkillReference

References a skill created with the /v1/skills endpoint.

Version stringOptional

Optional skill version. Use a positive integer or ‘latest’. Omit for default.

type BetaInlineSkill struct{…}
Description string

The description of the skill.

Name string

The name of the skill.

Inline skill payload

Data string

Base64-encoded skill zip bundle.

minLength1
maxLength70254592
MediaType ApplicationZip

The media type of the inline skill payload. Must be application/zip.

Type Base64

The type of the inline skill source. Must be base64.

Type Inline

Defines an inline skill for this request.

type BetaLocalEnvironment struct{…}
Type Local

Use a local computer environment.

Skills []BetaLocalSkillOptional

An optional list of skills.

Description string

The description of the skill.

Name string

The name of the skill.

Path string

The path to the directory containing the skill.

type BetaContainerReference struct{…}
ContainerID string

The ID of the referenced container.

Type ContainerReference

References a container created with the /v1/containers endpoint

type BetaCustomTool struct{…}

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

Name string

The name of the custom tool, used to identify it in tool calls.

Type Custom

The type of the custom tool. Always custom.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"
const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"
Async boolOptional

Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

DeferLoading boolOptional

Whether this tool should be deferred and discovered via tool search.

Description stringOptional

Optional description of the custom tool, used to provide more context.

Format BetaCustomToolFormatUnionOptional

The input format for the custom tool. Default is unconstrained text.

One of the following:
type BetaCustomToolFormatText struct{…}

Unconstrained free-form text.

Type Text

Unconstrained text format. Always text.

type BetaCustomToolFormatGrammar struct{…}

A grammar defined by the user.

Definition string

The grammar definition.

Syntax string

The syntax of the grammar definition. One of lark or regex.

One of the following:
const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"
const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"
Type Grammar

Grammar format. Always grammar.

type BetaNamespaceTool struct{…}

Groups function/custom tools under a shared namespace.

Description string

A description of the namespace shown to the model.

Name string

The namespace name used in tool calls (for example, crm).

minLength1
Tools []BetaNamespaceToolToolUnion

The function/custom tools available inside this namespace.

One of the following:
type BetaNamespaceToolToolFunction struct{…}
Name string
minLength1
maxLength128
Type Function
AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaNamespaceToolToolFunctionAllowedCallerDirect BetaNamespaceToolToolFunctionAllowedCaller = "direct"
const BetaNamespaceToolToolFunctionAllowedCallerProgrammatic BetaNamespaceToolToolFunctionAllowedCaller = "programmatic"
Async boolOptional

Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

DeferLoading boolOptional

Whether this function should be deferred and discovered via tool search.

Description stringOptional
OutputSchema map[string, any]Optional

A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

Parameters anyOptional
Strict boolOptional

Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

type BetaCustomTool struct{…}

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

Name string

The name of the custom tool, used to identify it in tool calls.

Type Custom

The type of the custom tool. Always custom.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaCustomToolAllowedCallerDirect BetaCustomToolAllowedCaller = "direct"
const BetaCustomToolAllowedCallerProgrammatic BetaCustomToolAllowedCaller = "programmatic"
Async boolOptional

Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

DeferLoading boolOptional

Whether this tool should be deferred and discovered via tool search.

Description stringOptional

Optional description of the custom tool, used to provide more context.

Format BetaCustomToolFormatUnionOptional

The input format for the custom tool. Default is unconstrained text.

One of the following:
type BetaCustomToolFormatText struct{…}

Unconstrained free-form text.

Type Text

Unconstrained text format. Always text.

type BetaCustomToolFormatGrammar struct{…}

A grammar defined by the user.

Definition string

The grammar definition.

Syntax string

The syntax of the grammar definition. One of lark or regex.

One of the following:
const BetaCustomToolFormatGrammarSyntaxLark BetaCustomToolFormatGrammarSyntax = "lark"
const BetaCustomToolFormatGrammarSyntaxRegex BetaCustomToolFormatGrammarSyntax = "regex"
Type Grammar

Grammar format. Always grammar.

Type Namespace

The type of the tool. Always namespace.

type BetaToolSearchTool struct{…}

Hosted or BYOT tool search configuration for deferred tools.

Type ToolSearch

The type of the tool. Always tool_search.

Description stringOptional

Description shown to the model for a client-executed tool search tool.

Execution BetaToolSearchToolExecutionOptional

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

One of the following:
const BetaToolSearchToolExecutionServer BetaToolSearchToolExecution = "server"
const BetaToolSearchToolExecutionClient BetaToolSearchToolExecution = "client"
Parameters anyOptional

Parameter schema for a client-executed tool search tool.

type BetaWebSearchPreviewTool struct{…}

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

Type BetaWebSearchPreviewToolType

The type of the web search tool. One of web_search_preview or web_search_preview_2025_03_11.

One of the following:
const BetaWebSearchPreviewToolTypeWebSearchPreview BetaWebSearchPreviewToolType = "web_search_preview"
const BetaWebSearchPreviewToolTypeWebSearchPreview2025_03_11 BetaWebSearchPreviewToolType = "web_search_preview_2025_03_11"
SearchContentTypes []stringOptional
One of the following:
const BetaWebSearchPreviewToolSearchContentTypeText BetaWebSearchPreviewToolSearchContentType = "text"
const BetaWebSearchPreviewToolSearchContentTypeImage BetaWebSearchPreviewToolSearchContentType = "image"
SearchContextSize BetaWebSearchPreviewToolSearchContextSizeOptional

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:
const BetaWebSearchPreviewToolSearchContextSizeLow BetaWebSearchPreviewToolSearchContextSize = "low"
const BetaWebSearchPreviewToolSearchContextSizeMedium BetaWebSearchPreviewToolSearchContextSize = "medium"
const BetaWebSearchPreviewToolSearchContextSizeHigh BetaWebSearchPreviewToolSearchContextSize = "high"
UserLocation BetaWebSearchPreviewToolUserLocationOptional

The user’s location.

Type Approximate

The type of location approximation. Always approximate.

City stringOptional

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

Country stringOptional

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

Region stringOptional

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

Timezone stringOptional

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

type BetaApplyPatchTool struct{…}

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

Type ApplyPatch

The type of the tool. Always apply_patch.

AllowedCallers []stringOptional

The tool invocation context(s).

One of the following:
const BetaApplyPatchToolAllowedCallerDirect BetaApplyPatchToolAllowedCaller = "direct"
const BetaApplyPatchToolAllowedCallerProgrammatic BetaApplyPatchToolAllowedCaller = "programmatic"