diff --git a/en/resources/responses/methods/create/index.md b/en/resources/responses/methods/create/index.md index d64fc1f..0cfbaed 100644 --- a/en/resources/responses/methods/create/index.md +++ b/en/resources/responses/methods/create/index.md @@ -74,7 +74,7 @@ as input for the model's response. - `"message.output_text.logprobs"` -- `input: optional string or array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 26 more` +- `input: optional string or array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 27 more` Text, image, or file inputs to the model, used to generate a response. @@ -91,7 +91,7 @@ as input for the model's response. A text input to the model, equivalent to a text input with the `user` role. - - `InputItemList = array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 26 more` + - `InputItemList = array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 27 more` A list of one or many input items to the model, containing different content types. @@ -874,19 +874,15 @@ as input for the model's response. The unique ID of the web search tool call. - - `action: object { query, type, queries, sources } or object { type, url } or object { pattern, type, url }` + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` An object describing the specific action taken in this web search call. Includes details on how the model used the web (search, open_page, find_in_page). - - `Search object { query, type, queries, sources }` + - `Search object { type, queries, query, sources }` Action type "search" - Performs a web search query. - - `query: string` - - [DEPRECATED] The search query. - - `type: "search"` The action type. @@ -897,6 +893,10 @@ as input for the model's response. The search queries. + - `query: optional string` + + The search query. + - `sources: optional array of object { type, url }` The sources used in the search. @@ -2168,2092 +2168,4304 @@ as input for the model's response. - `"incomplete"` - - `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](/docs/guides/conversation-state). + - `AdditionalTools object { role, tools, type, id }` - - `id: string` + - `role: "developer"` - The unique identifier of the reasoning content. + The role that provided the additional tools. Only `developer` is supported. - - `summary: array of SummaryTextContent` + - `"developer"` - Reasoning summary content. + - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` - - `text: string` + A list of additional tools made available at this item. - A summary of the reasoning output from the model so far. + - `Function object { name, parameters, strict, 3 more }` - - `type: "summary_text"` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The type of the object. Always `summary_text`. + - `name: string` - - `"summary_text"` + The name of the function to call. - - `type: "reasoning"` + - `parameters: map[unknown]` - The type of the object. Always `reasoning`. + A JSON schema object describing the parameters of the function. - - `"reasoning"` + - `strict: boolean` - - `content: optional array of object { text, type }` + Whether to enforce strict parameter validation. Default `true`. - Reasoning text content. + - `type: "function"` - - `text: string` + The type of the function tool. Always `function`. - The reasoning text from the model. + - `"function"` - - `type: "reasoning_text"` + - `defer_loading: optional boolean` - The type of the reasoning text. Always `reasoning_text`. + Whether this function is deferred and loaded via tool search. - - `"reasoning_text"` + - `description: optional string` - - `encrypted_content: optional string` + A description of the function. Used by the model to determine whether or not to call the function. - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - `status: optional "in_progress" or "completed" or "incomplete"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `type: "file_search"` - - `"in_progress"` + The type of the file search tool. Always `file_search`. - - `"completed"` + - `"file_search"` - - `"incomplete"` + - `vector_store_ids: array of string` - - `Compaction object { encrypted_content, type, id }` + The IDs of the vector stores to search. - A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). + - `filters: optional ComparisonFilter or CompoundFilter` - - `encrypted_content: string` + A filter to apply. - The encrypted content of the compaction summary. + - `ComparisonFilter object { key, type, value }` - - `type: "compaction"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - The type of the item. Always `compaction`. + - `CompoundFilter object { filters, type }` - - `"compaction"` + Combine multiple filters using `and` or `or`. - - `id: optional string` + - `max_num_results: optional number` - The ID of the compaction item. + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `ImageGenerationCall object { id, result, status, type }` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - An image generation request made by the model. + Ranking options for search. - - `id: string` + - `hybrid_search: optional object { embedding_weight, text_weight }` - The unique ID of the image generation call. + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `result: string` + - `embedding_weight: number` - The generated image encoded in base64. + The weight of the embedding in the reciprocal ranking fusion. - - `status: "in_progress" or "completed" or "generating" or "failed"` + - `text_weight: number` - The status of the image generation call. + The weight of the text in the reciprocal ranking fusion. - - `"in_progress"` + - `ranker: optional "auto" or "default-2024-11-15"` - - `"completed"` + The ranker to use for the file search. - - `"generating"` + - `"auto"` - - `"failed"` + - `"default-2024-11-15"` - - `type: "image_generation_call"` + - `score_threshold: optional number` - The type of the image generation call. Always `image_generation_call`. + 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. - - `"image_generation_call"` + - `Computer object { type }` - - `CodeInterpreterCall object { id, code, container_id, 3 more }` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - A tool call to run code. + - `type: "computer"` - - `id: string` + The type of the computer tool. Always `computer`. - The unique ID of the code interpreter tool call. + - `"computer"` - - `code: string` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - The code to run, or null if not available. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `container_id: string` + - `display_height: number` - The ID of the container used to run the code. + The height of the computer display. - - `outputs: array of object { logs, type } or object { type, url }` + - `display_width: number` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + The width of the computer display. - - `Logs object { logs, type }` + - `environment: "windows" or "mac" or "linux" or 2 more` - The logs output from the code interpreter. + The type of computer environment to control. - - `logs: string` + - `"windows"` - The logs output from the code interpreter. + - `"mac"` - - `type: "logs"` + - `"linux"` - The type of the output. Always `logs`. + - `"ubuntu"` - - `"logs"` + - `"browser"` - - `Image object { type, url }` + - `type: "computer_use_preview"` - The image output from the code interpreter. + The type of the computer use tool. Always `computer_use_preview`. - - `type: "image"` + - `"computer_use_preview"` - The type of the output. Always `image`. + - `WebSearch object { type, filters, search_context_size, user_location }` - - `"image"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `url: string` + - `type: "web_search" or "web_search_2025_08_26"` - The URL of the image output from the code interpreter. + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `status: "in_progress" or "completed" or "incomplete" or 2 more` + - `"web_search"` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `"web_search_2025_08_26"` - - `"in_progress"` + - `filters: optional object { allowed_domains }` - - `"completed"` + Filters for the search. - - `"incomplete"` + - `allowed_domains: optional array of string` - - `"interpreting"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `"failed"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `type: "code_interpreter_call"` + - `search_context_size: optional "low" or "medium" or "high"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + 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. - - `"code_interpreter_call"` + - `"low"` - - `LocalShellCall object { id, action, call_id, 2 more }` + - `"medium"` - A tool call to run a command on the local shell. + - `"high"` - - `id: string` + - `user_location: optional object { city, country, region, 2 more }` - The unique ID of the local shell call. + The approximate location of the user. - - `action: object { command, env, type, 3 more }` + - `city: optional string` - Execute a shell command on the server. + Free text input for the city of the user, e.g. `San Francisco`. - - `command: array of string` + - `country: optional string` - The command to run. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `env: map[string]` + - `region: optional string` - Environment variables to set for the command. + Free text input for the region of the user, e.g. `California`. - - `type: "exec"` + - `timezone: optional string` - The type of the local shell action. Always `exec`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `"exec"` + - `type: optional "approximate"` - - `timeout_ms: optional number` + The type of location approximation. Always `approximate`. - Optional timeout in milliseconds for the command. + - `"approximate"` - - `user: optional string` + - `Mcp object { server_label, type, allowed_tools, 7 more }` - Optional user to run the command as. + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - - `working_directory: optional string` + - `server_label: string` - Optional working directory to run the command in. + A label for this MCP server, used to identify it in tool calls. - - `call_id: string` + - `type: "mcp"` - The unique ID of the local shell tool call generated by the model. + The type of the MCP tool. Always `mcp`. - - `status: "in_progress" or "completed" or "incomplete"` + - `"mcp"` - The status of the local shell call. + - `allowed_tools: optional array of string or object { read_only, tool_names }` - - `"in_progress"` + List of allowed tool names or a filter object. - - `"completed"` + - `McpAllowedTools = array of string` - - `"incomplete"` + A string array of allowed tool names - - `type: "local_shell_call"` + - `McpToolFilter object { read_only, tool_names }` - The type of the local shell call. Always `local_shell_call`. + A filter object to specify which tools are allowed. - - `"local_shell_call"` + - `read_only: optional boolean` - - `LocalShellCallOutput object { id, output, type, status }` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - The output of a local shell tool call. + - `tool_names: optional array of string` - - `id: string` + List of allowed tool names. - The unique ID of the local shell tool call generated by the model. + - `authorization: optional string` - - `output: 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. - A JSON string of the output of the local shell tool call. + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - `type: "local_shell_call_output"` + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](/docs/guides/tools-remote-mcp#connectors). - The type of the local shell tool call output. Always `local_shell_call_output`. + Currently supported `connector_id` values are: - - `"local_shell_call_output"` + - 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` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"connector_dropbox"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + - `"connector_gmail"` - - `"in_progress"` + - `"connector_googlecalendar"` - - `"completed"` + - `"connector_googledrive"` - - `"incomplete"` + - `"connector_microsoftteams"` - - `ShellCall object { action, call_id, type, 3 more }` + - `"connector_outlookcalendar"` - A tool representing a request to execute one or more shell commands. + - `"connector_outlookemail"` - - `action: object { commands, max_output_length, timeout_ms }` + - `"connector_sharepoint"` - The shell commands and limits that describe how to run the tool call. + - `defer_loading: optional boolean` - - `commands: array of string` + Whether this MCP tool is deferred and discovered via tool search. - Ordered shell commands for the execution environment to run. + - `headers: optional map[string]` - - `max_output_length: optional number` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + - `require_approval: optional object { always, never } or "always" or "never"` - - `timeout_ms: optional number` + Specify which of the MCP server's tools require approval. - Maximum wall-clock time in milliseconds to allow the shell commands to run. + - `McpToolApprovalFilter object { always, never }` - - `call_id: string` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - The unique ID of the shell tool call generated by the model. + - `always: optional object { read_only, tool_names }` - - `type: "shell_call"` + A filter object to specify which tools are allowed. - The type of the item. Always `shell_call`. + - `read_only: optional boolean` - - `"shell_call"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `id: optional string` + - `tool_names: optional array of string` - The unique ID of the shell tool call. Populated when this item is returned via API. + List of allowed tool names. - - `environment: optional LocalEnvironment or ContainerReference` + - `never: optional object { read_only, tool_names }` - The environment to execute the shell commands in. + A filter object to specify which tools are allowed. - - `LocalEnvironment object { type, skills }` + - `read_only: optional boolean` - - `ContainerReference object { container_id, type }` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `tool_names: optional array of string` - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + List of allowed tool names. - - `"in_progress"` + - `McpToolApprovalSetting = "always" or "never"` - - `"completed"` + 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. - - `"incomplete"` + - `"always"` - - `ShellCallOutput object { call_id, output, type, 3 more }` + - `"never"` - The streamed output items emitted by a shell tool call. + - `server_description: optional string` - - `call_id: string` + Optional description of the MCP server, used to provide more context. - The unique ID of the shell tool call generated by the model. + - `server_url: optional string` - - `output: array of ResponseFunctionShellCallOutputContent` + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `CodeInterpreter object { container, type }` - - `outcome: object { type } or object { exit_code, type }` + A tool that runs Python code to help generate a response to a prompt. - The exit or timeout outcome associated with this shell call. + - `container: string or object { type, file_ids, memory_limit, network_policy }` - - `Timeout object { type }` + 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. - Indicates that the shell call exceeded its configured time limit. + - `string` - - `type: "timeout"` + The container ID. - The outcome type. Always `timeout`. + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `"timeout"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `Exit object { exit_code, type }` + - `type: "auto"` - Indicates that the shell commands finished and returned an exit code. + Always `auto`. - - `exit_code: number` + - `"auto"` - The exit code returned by the shell process. + - `file_ids: optional array of string` - - `type: "exit"` + An optional list of uploaded files to make available to your code. - The outcome type. Always `exit`. + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `"exit"` + The memory limit for the code interpreter container. - - `stderr: string` + - `"1g"` - Captured stderr output for the shell call. + - `"4g"` - - `stdout: string` + - `"16g"` - Captured stdout output for the shell call. + - `"64g"` - - `type: "shell_call_output"` + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` - The type of the item. Always `shell_call_output`. + Network access policy for the container. - - `"shell_call_output"` + - `ContainerNetworkPolicyDisabled object { type }` - - `id: optional string` + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - The unique ID of the shell tool call output. Populated when this item is returned via API. + - `type: "code_interpreter"` - - `max_output_length: optional number` + The type of the code interpreter tool. Always `code_interpreter`. - The maximum number of UTF-8 characters captured for this shell call's combined output. + - `"code_interpreter"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `ImageGeneration object { type, action, background, 9 more }` - The status of the shell call output. + A tool that generates images using the GPT image models. - - `"in_progress"` + - `type: "image_generation"` - - `"completed"` + The type of the image generation tool. Always `image_generation`. - - `"incomplete"` + - `"image_generation"` - - `ApplyPatchCall object { call_id, operation, status, 2 more }` + - `action: optional "generate" or "edit" or "auto"` - A tool call representing a request to create, delete, or update files using diff patches. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `call_id: string` + - `"generate"` - The unique ID of the apply patch tool call generated by the model. + - `"edit"` - - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` + - `"auto"` - The specific create, delete, or update instruction for the apply_patch tool call. + - `background: optional "transparent" or "opaque" or "auto"` - - `CreateFile object { diff, path, type }` + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - Instruction for creating a new file via the apply_patch tool. + - `"transparent"` - - `diff: string` + - `"opaque"` - Unified diff content to apply when creating the file. + - `"auto"` - - `path: string` + - `input_fidelity: optional "high" or "low"` - Path of the file to create relative to the workspace root. + 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`. - - `type: "create_file"` + - `"high"` - The operation type. Always `create_file`. + - `"low"` - - `"create_file"` + - `input_image_mask: optional object { file_id, image_url }` - - `DeleteFile object { path, type }` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - Instruction for deleting an existing file via the apply_patch tool. + - `file_id: optional string` - - `path: string` + File ID for the mask image. - Path of the file to delete relative to the workspace root. + - `image_url: optional string` - - `type: "delete_file"` + Base64-encoded mask image. - The operation type. Always `delete_file`. + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `"delete_file"` + The image generation model to use. Default: `gpt-image-1`. - - `UpdateFile object { diff, path, type }` + - `string` - Instruction for updating an existing file via the apply_patch tool. + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `diff: string` + The image generation model to use. Default: `gpt-image-1`. - Unified diff content to apply to the existing file. + - `"gpt-image-1"` - - `path: string` + - `"gpt-image-1-mini"` - Path of the file to update relative to the workspace root. + - `"gpt-image-1.5"` - - `type: "update_file"` + - `moderation: optional "auto" or "low"` - The operation type. Always `update_file`. + Moderation level for the generated image. Default: `auto`. - - `"update_file"` + - `"auto"` - - `status: "in_progress" or "completed"` + - `"low"` - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `output_compression: optional number` - - `"in_progress"` + Compression level for the output image. Default: 100. - - `"completed"` + - `output_format: optional "png" or "webp" or "jpeg"` - - `type: "apply_patch_call"` + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - The type of the item. Always `apply_patch_call`. + - `"png"` - - `"apply_patch_call"` + - `"webp"` - - `id: optional string` + - `"jpeg"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + - `partial_images: optional number` - - `ApplyPatchCallOutput object { call_id, status, type, 2 more }` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The streamed output emitted by an apply patch tool call. + - `quality: optional "low" or "medium" or "high" or "auto"` - - `call_id: string` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The unique ID of the apply patch tool call generated by the model. + - `"low"` - - `status: "completed" or "failed"` + - `"medium"` - The status of the apply patch tool call output. One of `completed` or `failed`. + - `"high"` - - `"completed"` + - `"auto"` - - `"failed"` + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `type: "apply_patch_call_output"` + 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`. - The type of the item. Always `apply_patch_call_output`. + - `string` - - `"apply_patch_call_output"` + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `id: optional string` + 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`. - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + - `"1024x1024"` - - `output: optional string` + - `"1024x1536"` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + - `"1536x1024"` - - `McpListTools object { id, server_label, tools, 2 more }` + - `"auto"` - A list of tools available on an MCP server. + - `LocalShell object { type }` - - `id: string` + A tool that allows the model to execute shell commands in a local environment. - The unique ID of the list. + - `type: "local_shell"` - - `server_label: string` + The type of the local shell tool. Always `local_shell`. - The label of the MCP server. + - `"local_shell"` - - `tools: array of object { input_schema, name, annotations, description }` + - `Shell object { type, environment }` - The tools available on the server. + A tool that allows the model to execute shell commands. - - `input_schema: unknown` + - `type: "shell"` - The JSON schema describing the tool's input. + The type of the shell tool. Always `shell`. - - `name: string` + - `"shell"` - The name of the tool. + - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` - - `annotations: optional unknown` + - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` - Additional annotations about the tool. + - `LocalEnvironment object { type, skills }` - - `description: optional string` + - `ContainerReference object { container_id, type }` - The description of the tool. + - `Custom object { name, type, defer_loading, 2 more }` - - `type: "mcp_list_tools"` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - The type of the item. Always `mcp_list_tools`. + - `name: string` - - `"mcp_list_tools"` + The name of the custom tool, used to identify it in tool calls. - - `error: optional string` + - `type: "custom"` - Error message if the server could not list tools. + The type of the custom tool. Always `custom`. - - `McpApprovalRequest object { id, arguments, name, 2 more }` + - `"custom"` - A request for human approval of a tool invocation. + - `defer_loading: optional boolean` - - `id: string` + Whether this tool should be deferred and discovered via tool search. - The unique ID of the approval request. + - `description: optional string` - - `arguments: string` + Optional description of the custom tool, used to provide more context. - A JSON string of arguments for the tool. + - `format: optional CustomToolInputFormat` - - `name: string` + The input format for the custom tool. Default is unconstrained text. - The name of the tool to run. + - `Namespace object { description, name, tools, type }` - - `server_label: string` + Groups function/custom tools under a shared namespace. - The label of the MCP server making the request. + - `description: string` - - `type: "mcp_approval_request"` + A description of the namespace shown to the model. - The type of the item. Always `mcp_approval_request`. + - `name: string` - - `"mcp_approval_request"` + The namespace name used in tool calls (for example, `crm`). - - `McpApprovalResponse object { approval_request_id, approve, type, 2 more }` + - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` - A response to an MCP approval request. + The function/custom tools available inside this namespace. - - `approval_request_id: string` + - `Function object { name, type, defer_loading, 3 more }` - The ID of the approval request being answered. + - `name: string` - - `approve: boolean` + - `type: "function"` - Whether the request was approved. + - `"function"` - - `type: "mcp_approval_response"` + - `defer_loading: optional boolean` - The type of the item. Always `mcp_approval_response`. + Whether this function should be deferred and discovered via tool search. - - `"mcp_approval_response"` + - `description: optional string` - - `id: optional string` + - `parameters: optional unknown` - The unique ID of the approval response + - `strict: optional boolean` - - `reason: optional string` + - `Custom object { name, type, defer_loading, 2 more }` - Optional reason for the decision. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `McpCall object { id, arguments, name, 6 more }` + - `name: string` - An invocation of a tool on an MCP server. + The name of the custom tool, used to identify it in tool calls. - - `id: string` + - `type: "custom"` - The unique ID of the tool call. + The type of the custom tool. Always `custom`. - - `arguments: string` + - `"custom"` - A JSON string of the arguments passed to the tool. + - `defer_loading: optional boolean` - - `name: string` + Whether this tool should be deferred and discovered via tool search. - The name of the tool that was run. + - `description: optional string` - - `server_label: string` + Optional description of the custom tool, used to provide more context. - The label of the MCP server running the tool. + - `format: optional CustomToolInputFormat` - - `type: "mcp_call"` + The input format for the custom tool. Default is unconstrained text. - The type of the item. Always `mcp_call`. + - `type: "namespace"` - - `"mcp_call"` + The type of the tool. Always `namespace`. - - `approval_request_id: optional string` + - `"namespace"` - 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. + - `ToolSearch object { type, description, execution, parameters }` - - `error: optional string` + Hosted or BYOT tool search configuration for deferred tools. - The error from the tool call, if any. + - `type: "tool_search"` - - `output: optional string` + The type of the tool. Always `tool_search`. - The output from the tool call. + - `"tool_search"` - - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + - `description: optional string` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + Description shown to the model for a client-executed tool search tool. - - `"in_progress"` + - `execution: optional "server" or "client"` - - `"completed"` + Whether tool search is executed by the server or by the client. - - `"incomplete"` + - `"server"` - - `"calling"` + - `"client"` - - `"failed"` + - `parameters: optional unknown` - - `CustomToolCallOutput object { call_id, output, type, id }` + Parameter schema for a client-executed tool search tool. - The output of a custom tool call from your code, being sent back to the model. + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - - `call_id: string` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - The call ID, used to map this custom tool call output to a custom tool call. + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + - `"web_search_preview"` - - `StringOutput = string` + - `"web_search_preview_2025_03_11"` - A string of the output of the custom tool call. + - `search_content_types: optional array of "text" or "image"` - - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` + - `"text"` - Text, image, or file output of the custom tool call. + - `"image"` - - `ResponseInputText object { text, type }` + - `search_context_size: optional "low" or "medium" or "high"` - A text input to the model. + 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. - - `ResponseInputImage object { detail, type, file_id, image_url }` + - `"low"` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `"medium"` - - `ResponseInputFile object { type, detail, file_data, 3 more }` + - `"high"` - A file input to the model. + - `user_location: optional object { type, city, country, 2 more }` - - `type: "custom_tool_call_output"` + The user's location. - The type of the custom tool call output. Always `custom_tool_call_output`. + - `type: "approximate"` - - `"custom_tool_call_output"` + The type of location approximation. Always `approximate`. - - `id: optional string` + - `"approximate"` - The unique ID of the custom tool call output in the OpenAI platform. + - `city: optional string` - - `CustomToolCall object { call_id, input, name, 3 more }` + Free text input for the city of the user, e.g. `San Francisco`. - A call to a custom tool created by the model. + - `country: optional string` - - `call_id: string` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - An identifier used to map this custom tool call to a tool call output. + - `region: optional string` - - `input: string` + Free text input for the region of the user, e.g. `California`. - The input for the custom tool call generated by the model. + - `timezone: optional string` - - `name: string` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - The name of the custom tool being called. + - `ApplyPatch object { type }` - - `type: "custom_tool_call"` + Allows the assistant to create, delete, or update files using unified diffs. - The type of the custom tool call. Always `custom_tool_call`. + - `type: "apply_patch"` - - `"custom_tool_call"` + The type of the tool. Always `apply_patch`. - - `id: optional string` + - `"apply_patch"` - The unique ID of the custom tool call in the OpenAI platform. + - `type: "additional_tools"` - - `namespace: optional string` + The item type. Always `additional_tools`. - The namespace of the custom tool being called. + - `"additional_tools"` - - `CompactionTrigger object { type }` + - `id: optional string` - Compacts the current context. Must be the final input item. + The unique ID of this additional tools item. - - `type: "compaction_trigger"` + - `Reasoning object { id, summary, type, 3 more }` - The type of the item. Always `compaction_trigger`. + 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](/docs/guides/conversation-state). - - `"compaction_trigger"` + - `id: string` - - `ItemReference object { id, type }` + The unique identifier of the reasoning content. - An internal identifier for an item to reference. + - `summary: array of SummaryTextContent` - - `id: string` + Reasoning summary content. - The ID of the item to reference. + - `text: string` - - `type: optional "item_reference"` + A summary of the reasoning output from the model so far. - The type of item to reference. Always `item_reference`. + - `type: "summary_text"` - - `"item_reference"` + The type of the object. Always `summary_text`. -- `instructions: optional string` + - `"summary_text"` - A system (or developer) message inserted into the model's context. + - `type: "reasoning"` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + The type of the object. Always `reasoning`. -- `max_output_tokens: optional number` + - `"reasoning"` - An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). + - `content: optional array of object { text, type }` -- `max_tool_calls: optional number` + Reasoning text content. - The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + - `text: string` -- `metadata: optional Metadata` + The reasoning text from the model. - 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. + - `type: "reasoning_text"` - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + The type of the reasoning text. Always `reasoning_text`. -- `model: optional ResponsesModel` + - `"reasoning_text"` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + - `encrypted_content: optional string` - - `string` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"gpt-5.4"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `"gpt-5.4-mini"` + - `"in_progress"` - - `"gpt-5.4-nano"` + - `"completed"` - - `"gpt-5.4-mini-2026-03-17"` + - `"incomplete"` - - `"gpt-5.4-nano-2026-03-17"` + - `Compaction object { encrypted_content, type, id }` - - `"gpt-5.3-chat-latest"` + A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - `"gpt-5.2"` + - `encrypted_content: string` - - `"gpt-5.2-2025-12-11"` + The encrypted content of the compaction summary. - - `"gpt-5.2-chat-latest"` + - `type: "compaction"` - - `"gpt-5.2-pro"` + The type of the item. Always `compaction`. - - `"gpt-5.2-pro-2025-12-11"` + - `"compaction"` - - `"gpt-5.1"` + - `id: optional string` - - `"gpt-5.1-2025-11-13"` + The ID of the compaction item. - - `"gpt-5.1-codex"` + - `ImageGenerationCall object { id, result, status, type }` - - `"gpt-5.1-mini"` + An image generation request made by the model. - - `"gpt-5.1-chat-latest"` + - `id: string` - - `"gpt-5"` + The unique ID of the image generation call. - - `"gpt-5-mini"` + - `result: string` - - `"gpt-5-nano"` + The generated image encoded in base64. - - `"gpt-5-2025-08-07"` + - `status: "in_progress" or "completed" or "generating" or "failed"` - - `"gpt-5-mini-2025-08-07"` + The status of the image generation call. - - `"gpt-5-nano-2025-08-07"` + - `"in_progress"` - - `"gpt-5-chat-latest"` + - `"completed"` - - `"gpt-4.1"` + - `"generating"` - - `"gpt-4.1-mini"` + - `"failed"` - - `"gpt-4.1-nano"` + - `type: "image_generation_call"` - - `"gpt-4.1-2025-04-14"` + The type of the image generation call. Always `image_generation_call`. - - `"gpt-4.1-mini-2025-04-14"` + - `"image_generation_call"` - - `"gpt-4.1-nano-2025-04-14"` + - `CodeInterpreterCall object { id, code, container_id, 3 more }` - - `"o4-mini"` + A tool call to run code. - - `"o4-mini-2025-04-16"` + - `id: string` - - `"o3"` + The unique ID of the code interpreter tool call. - - `"o3-2025-04-16"` + - `code: string` - - `"o3-mini"` + The code to run, or null if not available. - - `"o3-mini-2025-01-31"` + - `container_id: string` - - `"o1"` + The ID of the container used to run the code. - - `"o1-2024-12-17"` + - `outputs: array of object { logs, type } or object { type, url }` - - `"o1-preview"` + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `"o1-preview-2024-09-12"` + - `Logs object { logs, type }` - - `"o1-mini"` + The logs output from the code interpreter. - - `"o1-mini-2024-09-12"` + - `logs: string` - - `"gpt-4o"` + The logs output from the code interpreter. - - `"gpt-4o-2024-11-20"` + - `type: "logs"` - - `"gpt-4o-2024-08-06"` + The type of the output. Always `logs`. - - `"gpt-4o-2024-05-13"` + - `"logs"` - - `"gpt-4o-audio-preview"` + - `Image object { type, url }` - - `"gpt-4o-audio-preview-2024-10-01"` + The image output from the code interpreter. - - `"gpt-4o-audio-preview-2024-12-17"` + - `type: "image"` - - `"gpt-4o-audio-preview-2025-06-03"` + The type of the output. Always `image`. - - `"gpt-4o-mini-audio-preview"` + - `"image"` - - `"gpt-4o-mini-audio-preview-2024-12-17"` + - `url: string` - - `"gpt-4o-search-preview"` + The URL of the image output from the code interpreter. - - `"gpt-4o-mini-search-preview"` + - `status: "in_progress" or "completed" or "incomplete" or 2 more` - - `"gpt-4o-search-preview-2025-03-11"` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `"gpt-4o-mini-search-preview-2025-03-11"` + - `"in_progress"` - - `"chatgpt-4o-latest"` + - `"completed"` - - `"codex-mini-latest"` + - `"incomplete"` - - `"gpt-4o-mini"` + - `"interpreting"` - - `"gpt-4o-mini-2024-07-18"` + - `"failed"` - - `"gpt-4-turbo"` + - `type: "code_interpreter_call"` - - `"gpt-4-turbo-2024-04-09"` + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `"gpt-4-0125-preview"` + - `"code_interpreter_call"` - - `"gpt-4-turbo-preview"` + - `LocalShellCall object { id, action, call_id, 2 more }` - - `"gpt-4-1106-preview"` + A tool call to run a command on the local shell. - - `"gpt-4-vision-preview"` + - `id: string` - - `"gpt-4"` + The unique ID of the local shell call. - - `"gpt-4-0314"` + - `action: object { command, env, type, 3 more }` - - `"gpt-4-0613"` + Execute a shell command on the server. - - `"gpt-4-32k"` + - `command: array of string` - - `"gpt-4-32k-0314"` + The command to run. - - `"gpt-4-32k-0613"` + - `env: map[string]` - - `"gpt-3.5-turbo"` + Environment variables to set for the command. - - `"gpt-3.5-turbo-16k"` + - `type: "exec"` - - `"gpt-3.5-turbo-0301"` + The type of the local shell action. Always `exec`. - - `"gpt-3.5-turbo-0613"` + - `"exec"` - - `"gpt-3.5-turbo-1106"` + - `timeout_ms: optional number` - - `"gpt-3.5-turbo-0125"` + Optional timeout in milliseconds for the command. - - `"gpt-3.5-turbo-16k-0613"` + - `user: optional string` - - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more` + Optional user to run the command as. - - `"o1-pro"` + - `working_directory: optional string` - - `"o1-pro-2025-03-19"` + Optional working directory to run the command in. - - `"o3-pro"` + - `call_id: string` - - `"o3-pro-2025-06-10"` + The unique ID of the local shell tool call generated by the model. - - `"o3-deep-research"` + - `status: "in_progress" or "completed" or "incomplete"` - - `"o3-deep-research-2025-06-26"` + The status of the local shell call. - - `"o4-mini-deep-research"` + - `"in_progress"` - - `"o4-mini-deep-research-2025-06-26"` + - `"completed"` - - `"computer-use-preview"` + - `"incomplete"` - - `"computer-use-preview-2025-03-11"` + - `type: "local_shell_call"` - - `"gpt-5-codex"` + The type of the local shell call. Always `local_shell_call`. - - `"gpt-5-pro"` + - `"local_shell_call"` - - `"gpt-5-pro-2025-10-06"` + - `LocalShellCallOutput object { id, output, type, status }` - - `"gpt-5.1-codex-max"` + The output of a local shell tool call. -- `parallel_tool_calls: optional boolean` + - `id: string` - Whether to allow the model to run tool calls in parallel. + The unique ID of the local shell tool call generated by the model. -- `previous_response_id: optional string` + - `output: string` - The unique ID of the previous response to the model. Use this to - create multi-turn conversations. Learn more about - [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + A JSON string of the output of the local shell tool call. -- `prompt: optional ResponsePrompt` + - `type: "local_shell_call_output"` - Reference to a prompt template and its variables. - [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). + The type of the local shell tool call output. Always `local_shell_call_output`. - - `id: string` + - `"local_shell_call_output"` - The unique identifier of the prompt template to use. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]` + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. + - `"in_progress"` - - `string` + - `"completed"` - - `ResponseInputText object { text, type }` + - `"incomplete"` - A text input to the model. + - `ShellCall object { action, call_id, type, 3 more }` - - `ResponseInputImage object { detail, type, file_id, image_url }` + A tool representing a request to execute one or more shell commands. - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `action: object { commands, max_output_length, timeout_ms }` - - `ResponseInputFile object { type, detail, file_data, 3 more }` + The shell commands and limits that describe how to run the tool call. - A file input to the model. + - `commands: array of string` - - `version: optional string` + Ordered shell commands for the execution environment to run. - Optional version of the prompt template. + - `max_output_length: optional number` -- `prompt_cache_key: optional string` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). + - `timeout_ms: optional number` -- `prompt_cache_retention: optional "in_memory" or "24h"` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + - `call_id: string` - - `"in_memory"` + The unique ID of the shell tool call generated by the model. - - `"24h"` + - `type: "shell_call"` -- `reasoning: optional Reasoning` + The type of the item. Always `shell_call`. - **gpt-5 and o-series models only** + - `"shell_call"` - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). + - `id: optional string` - - `effort: optional ReasoningEffort` + The unique ID of the shell tool call. Populated when this item is returned via API. - Constrains effort on reasoning for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - reasoning effort can result in faster responses and fewer tokens used - on reasoning in a response. + - `environment: optional LocalEnvironment or ContainerReference` - - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + The environment to execute the shell commands in. - - `"none"` + - `LocalEnvironment object { type, skills }` - - `"minimal"` + - `ContainerReference object { container_id, type }` - - `"low"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"medium"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `"high"` + - `"in_progress"` - - `"xhigh"` + - `"completed"` - - `generate_summary: optional "auto" or "concise" or "detailed"` + - `"incomplete"` - **Deprecated:** use `summary` instead. + - `ShellCallOutput object { call_id, output, type, 3 more }` - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + The streamed output items emitted by a shell tool call. - - `"auto"` + - `call_id: string` - - `"concise"` + The unique ID of the shell tool call generated by the model. - - `"detailed"` + - `output: array of ResponseFunctionShellCallOutputContent` - - `summary: optional "auto" or "concise" or "detailed"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - A summary of the reasoning performed by the model. This can be - useful for debugging and understanding the model's reasoning process. - One of `auto`, `concise`, or `detailed`. + - `outcome: object { type } or object { exit_code, type }` - `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + The exit or timeout outcome associated with this shell call. - - `"auto"` + - `Timeout object { type }` - - `"concise"` + Indicates that the shell call exceeded its configured time limit. - - `"detailed"` + - `type: "timeout"` -- `safety_identifier: optional string` + The outcome type. Always `timeout`. - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + - `"timeout"` -- `service_tier: optional "auto" or "default" or "flex" or 2 more` + - `Exit object { exit_code, type }` - Specifies the processing type used for serving the request. + Indicates that the shell commands finished and returned an exit code. - - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. - - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. - - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. - - When not set, the default behavior is 'auto'. + - `exit_code: number` - When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + The exit code returned by the shell process. - - `"auto"` + - `type: "exit"` - - `"default"` + The outcome type. Always `exit`. - - `"flex"` + - `"exit"` - - `"scale"` + - `stderr: string` - - `"priority"` + Captured stderr output for the shell call. -- `store: optional boolean` + - `stdout: string` - Whether to store the generated model response for later retrieval via - API. + Captured stdout output for the shell call. -- `stream: optional boolean` + - `type: "shell_call_output"` - If set to true, the model response data will be streamed to the client - as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - See the [Streaming section below](/docs/api-reference/responses-streaming) - for more information. + The type of the item. Always `shell_call_output`. -- `stream_options: optional object { include_obfuscation }` + - `"shell_call_output"` - Options for streaming responses. Only set this when you set `stream: true`. + - `id: optional string` - - `include_obfuscation: optional boolean` + The unique ID of the shell tool call output. Populated when this item is returned via API. - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. + - `max_output_length: optional number` -- `temperature: optional number` + The maximum number of UTF-8 characters captured for this shell call's combined output. - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. + - `status: optional "in_progress" or "completed" or "incomplete"` -- `text: optional ResponseTextConfig` + The status of the shell call output. - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: + - `"in_progress"` - - [Text inputs and outputs](/docs/guides/text) - - [Structured Outputs](/docs/guides/structured-outputs) + - `"completed"` - - `format: optional ResponseFormatTextConfig` + - `"incomplete"` - An object specifying the format that the model must output. + - `ApplyPatchCall object { call_id, operation, status, 2 more }` - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](/docs/guides/structured-outputs). + A tool call representing a request to create, delete, or update files using diff patches. - The default format is `{ "type": "text" }` with no additional options. + - `call_id: string` - **Not recommended for gpt-4o and newer models:** + The unique ID of the apply patch tool call generated by the model. - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. + - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - - `ResponseFormatText object { type }` + The specific create, delete, or update instruction for the apply_patch tool call. - Default response format. Used to generate text responses. + - `CreateFile object { diff, path, type }` - - `type: "text"` + Instruction for creating a new file via the apply_patch tool. - The type of response format being defined. Always `text`. + - `diff: string` - - `"text"` + Unified diff content to apply when creating the file. - - `ResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` + - `path: string` - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](/docs/guides/structured-outputs). + Path of the file to create relative to the workspace root. - - `name: string` + - `type: "create_file"` - 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 operation type. Always `create_file`. - - `schema: map[unknown]` + - `"create_file"` - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). + - `DeleteFile object { path, type }` - - `type: "json_schema"` + Instruction for deleting an existing file via the apply_patch tool. - The type of response format being defined. Always `json_schema`. + - `path: string` - - `"json_schema"` + Path of the file to delete relative to the workspace root. - - `description: optional string` + - `type: "delete_file"` - A description of what the response format is for, used by the model to - determine how to respond in the format. + The operation type. Always `delete_file`. - - `strict: optional boolean` + - `"delete_file"` - 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](/docs/guides/structured-outputs). + - `UpdateFile object { diff, path, type }` - - `ResponseFormatJSONObject object { type }` + Instruction for updating an existing file via the apply_patch tool. - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. + - `diff: string` - - `type: "json_object"` + Unified diff content to apply to the existing file. - The type of response format being defined. Always `json_object`. + - `path: string` - - `"json_object"` + Path of the file to update relative to the workspace root. - - `verbosity: optional "low" or "medium" or "high"` + - `type: "update_file"` - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. + The operation type. Always `update_file`. - - `"low"` + - `"update_file"` - - `"medium"` + - `status: "in_progress" or "completed"` - - `"high"` + The status of the apply patch tool call. One of `in_progress` or `completed`. -- `tool_choice: optional ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 more` + - `"in_progress"` - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. + - `"completed"` - - `ToolChoiceOptions = "none" or "auto" or "required"` + - `type: "apply_patch_call"` - Controls which (if any) tool is called by the model. + The type of the item. Always `apply_patch_call`. - `none` means the model will not call any tool and instead generates a message. + - `"apply_patch_call"` - `auto` means the model can pick between generating a message or calling one or - more tools. + - `id: optional string` - `required` means the model must call one or more tools. + The unique ID of the apply patch tool call. Populated when this item is returned via API. + + - `ApplyPatchCallOutput object { call_id, status, type, 2 more }` + + The streamed output emitted by an apply patch tool call. + + - `call_id: string` + + The unique ID of the apply patch tool call generated by the model. + + - `status: "completed" or "failed"` + + The status of the apply patch tool call output. One of `completed` or `failed`. + + - `"completed"` + + - `"failed"` + + - `type: "apply_patch_call_output"` + + The type of the item. Always `apply_patch_call_output`. + + - `"apply_patch_call_output"` + + - `id: optional string` + + The unique ID of the apply patch tool call output. Populated when this item is returned via API. + + - `output: optional string` + + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + + - `McpListTools object { id, server_label, tools, 2 more }` + + A list of tools available on an MCP server. + + - `id: string` + + The unique ID of the list. + + - `server_label: string` + + The label of the MCP server. + + - `tools: array of object { input_schema, name, annotations, description }` + + The tools available on the server. + + - `input_schema: unknown` + + The JSON schema describing the tool's input. + + - `name: string` + + The name of the tool. + + - `annotations: optional unknown` + + Additional annotations about the tool. + + - `description: optional string` + + The description of the tool. + + - `type: "mcp_list_tools"` + + The type of the item. Always `mcp_list_tools`. + + - `"mcp_list_tools"` + + - `error: optional string` + + Error message if the server could not list tools. + + - `McpApprovalRequest object { id, arguments, name, 2 more }` + + A request for human approval of a tool invocation. + + - `id: string` + + The unique ID of the approval request. + + - `arguments: string` + + A JSON string of arguments for the tool. + + - `name: string` + + The name of the tool to run. + + - `server_label: string` + + The label of the MCP server making the request. + + - `type: "mcp_approval_request"` + + The type of the item. Always `mcp_approval_request`. + + - `"mcp_approval_request"` + + - `McpApprovalResponse object { approval_request_id, approve, type, 2 more }` + + A response to an MCP approval request. + + - `approval_request_id: string` + + The ID of the approval request being answered. + + - `approve: boolean` + + Whether the request was approved. + + - `type: "mcp_approval_response"` + + The type of the item. Always `mcp_approval_response`. + + - `"mcp_approval_response"` + + - `id: optional string` + + The unique ID of the approval response + + - `reason: optional string` + + Optional reason for the decision. + + - `McpCall object { id, arguments, name, 6 more }` + + An invocation of a tool on an MCP server. + + - `id: string` + + The unique ID of the tool call. + + - `arguments: string` + + A JSON string of the arguments passed to the tool. + + - `name: string` + + The name of the tool that was run. + + - `server_label: string` + + The label of the MCP server running the tool. + + - `type: "mcp_call"` + + The type of the item. Always `mcp_call`. + + - `"mcp_call"` + + - `approval_request_id: optional string` + + 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. + + - `error: optional string` + + The error from the tool call, if any. + + - `output: optional string` + + The output from the tool call. + + - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `"calling"` + + - `"failed"` + + - `CustomToolCallOutput object { call_id, output, type, id }` + + The output of a custom tool call from your code, being sent back to the model. + + - `call_id: string` + + The call ID, used to map this custom tool call output to a custom tool call. + + - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` + + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + + - `StringOutput = string` + + A string of the output of the custom tool call. + + - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` + + Text, image, or file output of the custom tool call. + + - `ResponseInputText object { text, type }` + + A text input to the model. + + - `ResponseInputImage object { detail, type, file_id, image_url }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `ResponseInputFile object { type, detail, file_data, 3 more }` + + A file input to the model. + + - `type: "custom_tool_call_output"` + + The type of the custom tool call output. Always `custom_tool_call_output`. + + - `"custom_tool_call_output"` + + - `id: optional string` + + The unique ID of the custom tool call output in the OpenAI platform. + + - `CustomToolCall object { call_id, input, name, 3 more }` + + A call to a custom tool created by the model. + + - `call_id: string` + + An identifier used to map this custom tool call to a tool call output. + + - `input: string` + + The input for the custom tool call generated by the model. + + - `name: string` + + The name of the custom tool being called. + + - `type: "custom_tool_call"` + + The type of the custom tool call. Always `custom_tool_call`. + + - `"custom_tool_call"` + + - `id: optional string` + + The unique ID of the custom tool call in the OpenAI platform. + + - `namespace: optional string` + + The namespace of the custom tool being called. + + - `CompactionTrigger object { type }` + + Compacts the current context. Must be the final input item. + + - `type: "compaction_trigger"` + + The type of the item. Always `compaction_trigger`. + + - `"compaction_trigger"` + + - `ItemReference object { id, type }` + + An internal identifier for an item to reference. + + - `id: string` + + The ID of the item to reference. + + - `type: optional "item_reference"` + + The type of item to reference. Always `item_reference`. + + - `"item_reference"` + +- `instructions: optional string` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + +- `max_output_tokens: optional number` + + An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](/docs/guides/reasoning). + +- `max_tool_calls: optional number` + + The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + +- `metadata: optional Metadata` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + +- `model: optional ResponsesModel` + + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. + + - `string` + + - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more` + + - `"gpt-5.4"` + + - `"gpt-5.4-mini"` + + - `"gpt-5.4-nano"` + + - `"gpt-5.4-mini-2026-03-17"` + + - `"gpt-5.4-nano-2026-03-17"` + + - `"gpt-5.3-chat-latest"` + + - `"gpt-5.2"` + + - `"gpt-5.2-2025-12-11"` + + - `"gpt-5.2-chat-latest"` + + - `"gpt-5.2-pro"` + + - `"gpt-5.2-pro-2025-12-11"` + + - `"gpt-5.1"` + + - `"gpt-5.1-2025-11-13"` + + - `"gpt-5.1-codex"` + + - `"gpt-5.1-mini"` + + - `"gpt-5.1-chat-latest"` + + - `"gpt-5"` + + - `"gpt-5-mini"` + + - `"gpt-5-nano"` + + - `"gpt-5-2025-08-07"` + + - `"gpt-5-mini-2025-08-07"` + + - `"gpt-5-nano-2025-08-07"` + + - `"gpt-5-chat-latest"` + + - `"gpt-4.1"` + + - `"gpt-4.1-mini"` + + - `"gpt-4.1-nano"` + + - `"gpt-4.1-2025-04-14"` + + - `"gpt-4.1-mini-2025-04-14"` + + - `"gpt-4.1-nano-2025-04-14"` + + - `"o4-mini"` + + - `"o4-mini-2025-04-16"` + + - `"o3"` + + - `"o3-2025-04-16"` + + - `"o3-mini"` + + - `"o3-mini-2025-01-31"` + + - `"o1"` + + - `"o1-2024-12-17"` + + - `"o1-preview"` + + - `"o1-preview-2024-09-12"` + + - `"o1-mini"` + + - `"o1-mini-2024-09-12"` + + - `"gpt-4o"` + + - `"gpt-4o-2024-11-20"` + + - `"gpt-4o-2024-08-06"` + + - `"gpt-4o-2024-05-13"` + + - `"gpt-4o-audio-preview"` + + - `"gpt-4o-audio-preview-2024-10-01"` + + - `"gpt-4o-audio-preview-2024-12-17"` + + - `"gpt-4o-audio-preview-2025-06-03"` + + - `"gpt-4o-mini-audio-preview"` + + - `"gpt-4o-mini-audio-preview-2024-12-17"` + + - `"gpt-4o-search-preview"` + + - `"gpt-4o-mini-search-preview"` + + - `"gpt-4o-search-preview-2025-03-11"` + + - `"gpt-4o-mini-search-preview-2025-03-11"` + + - `"chatgpt-4o-latest"` + + - `"codex-mini-latest"` + + - `"gpt-4o-mini"` + + - `"gpt-4o-mini-2024-07-18"` + + - `"gpt-4-turbo"` + + - `"gpt-4-turbo-2024-04-09"` + + - `"gpt-4-0125-preview"` + + - `"gpt-4-turbo-preview"` + + - `"gpt-4-1106-preview"` + + - `"gpt-4-vision-preview"` + + - `"gpt-4"` + + - `"gpt-4-0314"` + + - `"gpt-4-0613"` + + - `"gpt-4-32k"` + + - `"gpt-4-32k-0314"` + + - `"gpt-4-32k-0613"` + + - `"gpt-3.5-turbo"` + + - `"gpt-3.5-turbo-16k"` + + - `"gpt-3.5-turbo-0301"` + + - `"gpt-3.5-turbo-0613"` + + - `"gpt-3.5-turbo-1106"` + + - `"gpt-3.5-turbo-0125"` + + - `"gpt-3.5-turbo-16k-0613"` + + - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more` + + - `"o1-pro"` + + - `"o1-pro-2025-03-19"` + + - `"o3-pro"` + + - `"o3-pro-2025-06-10"` + + - `"o3-deep-research"` + + - `"o3-deep-research-2025-06-26"` + + - `"o4-mini-deep-research"` + + - `"o4-mini-deep-research-2025-06-26"` + + - `"computer-use-preview"` + + - `"computer-use-preview-2025-03-11"` + + - `"gpt-5-codex"` + + - `"gpt-5-pro"` + + - `"gpt-5-pro-2025-10-06"` + + - `"gpt-5.1-codex-max"` + +- `parallel_tool_calls: optional boolean` + + Whether to allow the model to run tool calls in parallel. + +- `previous_response_id: optional string` + + The unique ID of the previous response to the model. Use this to + create multi-turn conversations. Learn more about + [conversation state](/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`. + +- `prompt: optional ResponsePrompt` + + Reference to a prompt template and its variables. + [Learn more](/docs/guides/text?api-mode=responses#reusable-prompts). + + - `id: string` + + The unique identifier of the prompt template to use. + + - `variables: optional map[string or ResponseInputText or ResponseInputImage or ResponseInputFile]` + + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + + - `string` + + - `ResponseInputText object { text, type }` + + A text input to the model. + + - `ResponseInputImage object { detail, type, file_id, image_url }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `ResponseInputFile object { type, detail, file_data, 3 more }` + + A file input to the model. + + - `version: optional string` + + Optional version of the prompt template. + +- `prompt_cache_key: optional string` + + Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](/docs/guides/prompt-caching). + +- `prompt_cache_retention: optional "in_memory" or "24h"` + + The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. + + - `"in_memory"` + + - `"24h"` + +- `reasoning: optional Reasoning` + + **gpt-5 and o-series models only** + + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + + - `effort: optional ReasoningEffort` + + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing + reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + + - `"none"` + + - `"minimal"` + + - `"low"` + + - `"medium"` + + - `"high"` + + - `"xhigh"` + + - `generate_summary: optional "auto" or "concise" or "detailed"` + + **Deprecated:** use `summary` instead. + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + - `"auto"` + + - `"concise"` + + - `"detailed"` + + - `summary: optional "auto" or "concise" or "detailed"` + + A summary of the reasoning performed by the model. This can be + useful for debugging and understanding the model's reasoning process. + One of `auto`, `concise`, or `detailed`. + + `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`. + + - `"auto"` + + - `"concise"` + + - `"detailed"` + +- `safety_identifier: optional string` + + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user, with a maximum length of 64 characters. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + +- `service_tier: optional "auto" or "default" or "flex" or 2 more` + + Specifies the processing type used for serving the request. + + - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. + - If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. + - If set to '[flex](/docs/guides/flex-processing)' or '[priority](https://openai.com/api-priority-processing/)', then the request will be processed with the corresponding service tier. + - When not set, the default behavior is 'auto'. + + When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. + + - `"auto"` + + - `"default"` + + - `"flex"` + + - `"scale"` + + - `"priority"` + +- `store: optional boolean` + + Whether to store the generated model response for later retrieval via + API. + +- `stream: optional boolean` + + If set to true, the model response data will be streamed to the client + as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + See the [Streaming section below](/docs/api-reference/responses-streaming) + for more information. + +- `stream_options: optional object { include_obfuscation }` + + Options for streaming responses. Only set this when you set `stream: true`. + + - `include_obfuscation: optional boolean` + + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. + +- `temperature: optional number` + + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + +- `text: optional ResponseTextConfig` + + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + + - [Text inputs and outputs](/docs/guides/text) + - [Structured Outputs](/docs/guides/structured-outputs) + + - `format: optional ResponseFormatTextConfig` + + An object specifying the format that the model must output. + + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](/docs/guides/structured-outputs). + + The default format is `{ "type": "text" }` with no additional options. + + **Not recommended for gpt-4o and newer models:** + + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + + - `ResponseFormatText object { type }` + + Default response format. Used to generate text responses. + + - `type: "text"` + + The type of response format being defined. Always `text`. + + - `"text"` + + - `ResponseFormatTextJSONSchemaConfig object { name, schema, type, 2 more }` + + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](/docs/guides/structured-outputs). + + - `name: string` + + 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. + + - `schema: map[unknown]` + + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). + + - `type: "json_schema"` + + The type of response format being defined. Always `json_schema`. + + - `"json_schema"` + + - `description: optional string` + + A description of what the response format is for, used by the model to + determine how to respond in the format. + + - `strict: optional boolean` + + 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](/docs/guides/structured-outputs). + + - `ResponseFormatJSONObject object { type }` + + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + + - `type: "json_object"` + + The type of response format being defined. Always `json_object`. + + - `"json_object"` + + - `verbosity: optional "low" or "medium" or "high"` + + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + + - `"low"` + + - `"medium"` + + - `"high"` + +- `tool_choice: optional ToolChoiceOptions or ToolChoiceAllowed or ToolChoiceTypes or 5 more` + + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + + - `ToolChoiceOptions = "none" or "auto" or "required"` + + Controls which (if any) tool is called by the model. + + `none` means the model will not call any tool and instead generates a message. + + `auto` means the model can pick between generating a message or calling one or + more tools. + + `required` means the model must call one or more tools. - `"none"` - - `"auto"` + - `"auto"` + + - `"required"` + + - `ToolChoiceAllowed object { mode, tools, type }` + + Constrains the tools available to the model to a pre-defined set. + + - `mode: "auto" or "required"` + + Constrains the tools available to the model to a pre-defined set. + + `auto` allows the model to pick from among the allowed tools and generate a + message. + + `required` requires the model to call one or more of the allowed tools. + + - `"auto"` + + - `"required"` + + - `tools: array of map[unknown]` + + A list of tool definitions that the model should be allowed to call. + + For the Responses API, the list of tool definitions might look like: + + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + + - `type: "allowed_tools"` + + Allowed tool configuration type. Always `allowed_tools`. + + - `"allowed_tools"` + + - `ToolChoiceTypes object { type }` + + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](/docs/guides/tools). + + - `type: "file_search" or "web_search_preview" or "computer" or 5 more` + + The type of hosted tool the model should to use. Learn more about + [built-in tools](/docs/guides/tools). + + Allowed values are: + + - `file_search` + - `web_search_preview` + - `computer` + - `computer_use_preview` + - `computer_use` + - `code_interpreter` + - `image_generation` + + - `"file_search"` + + - `"web_search_preview"` + + - `"computer"` + + - `"computer_use_preview"` + + - `"computer_use"` + + - `"web_search_preview_2025_03_11"` + + - `"image_generation"` + + - `"code_interpreter"` + + - `ToolChoiceFunction object { name, type }` + + Use this option to force the model to call a specific function. + + - `name: string` + + The name of the function to call. + + - `type: "function"` + + For function calling, the type is always `function`. + + - `"function"` + + - `ToolChoiceMcp object { server_label, type, name }` + + Use this option to force the model to call a specific tool on a remote MCP server. + + - `server_label: string` + + The label of the MCP server to use. + + - `type: "mcp"` + + For MCP tools, the type is always `mcp`. + + - `"mcp"` + + - `name: optional string` + + The name of the tool to call on the server. + + - `ToolChoiceCustom object { name, type }` + + Use this option to force the model to call a specific custom tool. + + - `name: string` + + The name of the custom tool to call. + + - `type: "custom"` + + For custom tool calling, the type is always `custom`. + + - `"custom"` + + - `ToolChoiceApplyPatch object { type }` + + Forces the model to call the apply_patch tool when executing a tool call. + + - `type: "apply_patch"` + + The tool to call. Always `apply_patch`. + + - `"apply_patch"` + + - `ToolChoiceShell object { type }` + + Forces the model to call the shell tool when a tool call is required. + + - `type: "shell"` + + The tool to call. Always `shell`. + + - `"shell"` + +- `tools: optional array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` + + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + We support the following categories of tools: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](/docs/guides/tools-web-search) + or [file search](/docs/guides/tools-file-search). Learn more about + [built-in tools](/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](/docs/guides/function-calling). You can also use + custom tools to call your own code. + + - `Function object { name, parameters, strict, 3 more }` + + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + + - `name: string` + + The name of the function to call. + + - `parameters: map[unknown]` + + A JSON schema object describing the parameters of the function. + + - `strict: boolean` + + Whether to enforce strict parameter validation. Default `true`. + + - `type: "function"` + + The type of the function tool. Always `function`. + + - `"function"` + + - `defer_loading: optional boolean` + + Whether this function is deferred and loaded via tool search. + + - `description: optional string` + + A description of the function. Used by the model to determine whether or not to call the function. + + - `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](https://platform.openai.com/docs/guides/tools-file-search). + + - `type: "file_search"` + + The type of the file search tool. Always `file_search`. + + - `"file_search"` + + - `vector_store_ids: array of string` + + The IDs of the vector stores to search. + + - `filters: optional ComparisonFilter or CompoundFilter` + + 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. + + - `CompoundFilter object { filters, type }` + + Combine multiple filters using `and` or `or`. + + - `max_num_results: optional number` + + 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. + + - `hybrid_search: optional object { embedding_weight, text_weight }` + + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + + - `embedding_weight: number` + + The weight of the embedding in the reciprocal ranking fusion. + + - `text_weight: number` + + The weight of the text in the reciprocal ranking fusion. + + - `ranker: optional "auto" or "default-2024-11-15"` + + The ranker to use for the file search. + + - `"auto"` + + - `"default-2024-11-15"` + + - `score_threshold: optional 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. + + - `Computer object { type }` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `type: "computer"` + + The type of the computer tool. Always `computer`. + + - `"computer"` + + - `ComputerUsePreview object { display_height, display_width, environment, type }` + + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + + - `display_height: number` + + The height of the computer display. + + - `display_width: number` + + The width of the computer display. + + - `environment: "windows" or "mac" or "linux" or 2 more` + + The type of computer environment to control. + + - `"windows"` + + - `"mac"` + + - `"linux"` + + - `"ubuntu"` + + - `"browser"` + + - `type: "computer_use_preview"` + + The type of the computer use tool. Always `computer_use_preview`. + + - `"computer_use_preview"` + + - `WebSearch object { type, filters, search_context_size, user_location }` + + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). + + - `type: "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`. + + - `"web_search"` + + - `"web_search_2025_08_26"` + + - `filters: optional object { allowed_domains }` + + Filters for the search. + + - `allowed_domains: optional array of string` + + 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: 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. + + - `"low"` + + - `"medium"` + + - `"high"` + + - `user_location: optional object { city, country, region, 2 more }` + + The approximate location of the user. + + - `city: optional string` + + Free text input for the city of the user, e.g. `San Francisco`. + + - `country: optional string` + + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + + - `region: optional string` + + Free text input for the region of the user, e.g. `California`. + + - `timezone: optional string` + + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `type: optional "approximate"` + + The type of location approximation. Always `approximate`. + + - `"approximate"` + + - `Mcp object { server_label, type, allowed_tools, 7 more }` + + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-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`. + + - `"mcp"` + + - `allowed_tools: optional array of string or object { read_only, tool_names }` + + List of allowed tool names or a filter object. + + - `McpAllowedTools = array of string` + + A string array of allowed tool names + + - `McpToolFilter object { read_only, tool_names }` + + A filter object to specify which tools are allowed. + + - `read_only: optional boolean` + + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `tool_names: optional array of string` + + List of allowed tool names. + + - `authorization: optional 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: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` + + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](/docs/guides/tools-remote-mcp#connectors). + + 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` + + - `"connector_dropbox"` + + - `"connector_gmail"` + + - `"connector_googlecalendar"` + + - `"connector_googledrive"` + + - `"connector_microsoftteams"` + + - `"connector_outlookcalendar"` + + - `"connector_outlookemail"` + + - `"connector_sharepoint"` + + - `defer_loading: optional boolean` + + Whether this MCP tool is deferred and discovered via tool search. + + - `headers: optional map[string]` + + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. + + - `require_approval: optional object { always, never } or "always" or "never"` + + Specify which of the MCP server's tools require approval. + + - `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. + + - `always: optional object { read_only, tool_names }` + + A filter object to specify which tools are allowed. + + - `read_only: optional boolean` + + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `tool_names: optional array of string` + + List of allowed tool names. + + - `never: optional object { read_only, tool_names }` + + A filter object to specify which tools are allowed. + + - `read_only: optional boolean` + + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + + - `tool_names: optional array of string` + + List of allowed tool names. + + - `McpToolApprovalSetting = "always" or "never"` + + 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. + + - `"always"` + + - `"never"` + + - `server_description: optional string` + + Optional description of the MCP server, used to provide more context. + + - `server_url: optional string` + + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. + + - `CodeInterpreter object { container, type }` + + A tool that runs Python code to help generate a response to a prompt. + + - `container: string or object { type, file_ids, memory_limit, network_policy }` + + The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an + optional `memory_limit` setting. + + - `string` + + The container ID. + + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` + + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + + - `type: "auto"` + + Always `auto`. + + - `"auto"` + + - `file_ids: optional array of string` + + An optional list of uploaded files to make available to your code. + + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + + The memory limit for the code interpreter container. + + - `"1g"` + + - `"4g"` + + - `"16g"` + + - `"64g"` + + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` + + Network access policy for the container. + + - `ContainerNetworkPolicyDisabled object { type }` + + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + + - `type: "code_interpreter"` + + The type of the code interpreter tool. Always `code_interpreter`. + + - `"code_interpreter"` + + - `ImageGeneration object { type, action, background, 9 more }` + + A tool that generates images using the GPT image models. + + - `type: "image_generation"` + + The type of the image generation tool. Always `image_generation`. + + - `"image_generation"` + + - `action: optional "generate" or "edit" or "auto"` + + Whether to generate a new image or edit an existing image. Default: `auto`. + + - `"generate"` + + - `"edit"` + + - `"auto"` + + - `background: optional "transparent" or "opaque" or "auto"` + + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. + + - `"transparent"` + + - `"opaque"` + + - `"auto"` + + - `input_fidelity: optional "high" or "low"` + + Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1` and `gpt-image-1.5` and later models, unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + + - `"high"` + + - `"low"` + + - `input_image_mask: optional object { file_id, image_url }` + + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). + + - `file_id: optional string` + + File ID for the mask image. + + - `image_url: optional string` + + Base64-encoded mask image. + + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + + The image generation model to use. Default: `gpt-image-1`. + + - `string` + + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + + The image generation model to use. Default: `gpt-image-1`. + + - `"gpt-image-1"` + + - `"gpt-image-1-mini"` + + - `"gpt-image-1.5"` + + - `moderation: optional "auto" or "low"` + + Moderation level for the generated image. Default: `auto`. + + - `"auto"` + + - `"low"` + + - `output_compression: optional number` + + Compression level for the output image. Default: 100. + + - `output_format: optional "png" or "webp" or "jpeg"` + + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. + + - `"png"` + + - `"webp"` + + - `"jpeg"` + + - `partial_images: optional number` + + Number of partial images to generate in streaming mode, from 0 (default value) to 3. + + - `quality: optional "low" or "medium" or "high" or "auto"` + + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. + + - `"low"` + + - `"medium"` + + - `"high"` + + - `"auto"` + + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` + + The size of the generated images. For `gpt-image-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`. + + - `string` + + - `"1024x1024" or "1024x1536" or "1536x1024" or "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`. + + - `"1024x1024"` + + - `"1024x1536"` + + - `"1536x1024"` + + - `"auto"` + + - `LocalShell object { type }` + + A tool that allows the model to execute shell commands in a local environment. + + - `type: "local_shell"` + + The type of the local shell tool. Always `local_shell`. + + - `"local_shell"` + + - `Shell object { type, environment }` + + A tool that allows the model to execute shell commands. + + - `type: "shell"` + + The type of the shell tool. Always `shell`. + + - `"shell"` + + - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` + + - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` + + - `LocalEnvironment object { type, skills }` + + - `ContainerReference object { container_id, type }` + + - `Custom object { name, type, defer_loading, 2 more }` + + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#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`. + + - `"custom"` + + - `defer_loading: optional boolean` + + Whether this tool should be deferred and discovered via tool search. + + - `description: optional string` + + Optional description of the custom tool, used to provide more context. + + - `format: optional CustomToolInputFormat` + + The input format for the custom tool. Default is unconstrained text. + + - `Namespace object { description, name, tools, type }` + + 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`). + + - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` + + The function/custom tools available inside this namespace. + + - `Function object { name, type, defer_loading, 3 more }` + + - `name: string` + + - `type: "function"` + + - `"function"` + + - `defer_loading: optional boolean` + + Whether this function should be deferred and discovered via tool search. + + - `description: optional string` + + - `parameters: optional unknown` + + - `strict: optional boolean` + + - `Custom object { name, type, defer_loading, 2 more }` + + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#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`. + + - `"custom"` + + - `defer_loading: optional boolean` + + Whether this tool should be deferred and discovered via tool search. + + - `description: optional string` + + Optional description of the custom tool, used to provide more context. + + - `format: optional CustomToolInputFormat` + + The input format for the custom tool. Default is unconstrained text. + + - `type: "namespace"` + + The type of the tool. Always `namespace`. + + - `"namespace"` + + - `ToolSearch object { type, description, execution, parameters }` + + Hosted or BYOT tool search configuration for deferred tools. + + - `type: "tool_search"` + + The type of the tool. Always `tool_search`. + + - `"tool_search"` + + - `description: optional string` + + Description shown to the model for a client-executed tool search tool. + + - `execution: optional "server" or "client"` + + Whether tool search is executed by the server or by the client. + + - `"server"` + + - `"client"` + + - `parameters: optional unknown` + + Parameter schema for a client-executed tool search tool. + + - `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](https://platform.openai.com/docs/guides/tools-web-search). + + - `type: "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`. + + - `"web_search_preview"` + + - `"web_search_preview_2025_03_11"` + + - `search_content_types: optional array of "text" or "image"` + + - `"text"` + + - `"image"` + + - `search_context_size: optional "low" or "medium" or "high"` + + High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + + - `"low"` + + - `"medium"` + + - `"high"` + + - `user_location: optional object { type, city, country, 2 more }` + + The user's location. + + - `type: "approximate"` + + The type of location approximation. Always `approximate`. + + - `"approximate"` + + - `city: optional string` + + Free text input for the city of the user, e.g. `San Francisco`. + + - `country: optional string` + + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + + - `region: optional string` + + Free text input for the region of the user, e.g. `California`. + + - `timezone: optional string` + + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + + - `ApplyPatch object { type }` + + Allows the assistant to create, delete, or update files using unified diffs. + + - `type: "apply_patch"` + + The type of the tool. Always `apply_patch`. + + - `"apply_patch"` + +- `top_logprobs: optional number` + + An integer between 0 and 20 specifying the maximum number of most likely + tokens to return at each token position, each with an associated log + probability. In some cases, the number of returned tokens may be fewer than + requested. + +- `top_p: optional number` + + An alternative to sampling with temperature, called nucleus sampling, + where the model considers the results of the tokens with top_p probability + mass. So 0.1 means only the tokens comprising the top 10% probability mass + are considered. + + We generally recommend altering this or `temperature` but not both. + +- `truncation: optional "auto" or "disabled"` + + The truncation strategy to use for the model response. + + - `auto`: If the input to this Response exceeds + the model's context window size, the model will truncate the + response to fit the context window by dropping items from the beginning of the conversation. + - `disabled` (default): If the input size will exceed the context window + size for a model, the request will fail with a 400 error. + + - `"auto"` + + - `"disabled"` + +- `user: optional string` + + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + +### Returns + +- `Response object { id, created_at, error, 30 more }` + + - `id: string` + + Unique identifier for this Response. + + - `created_at: number` + + Unix timestamp (in seconds) of when this Response was created. + + - `error: ResponseError` + + An error object returned when the model fails to generate a Response. + + - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 more` + + The error code for the response. + + - `"server_error"` + + - `"rate_limit_exceeded"` + + - `"invalid_prompt"` + + - `"vector_store_timeout"` + + - `"invalid_image"` + + - `"invalid_image_format"` + + - `"invalid_base64_image"` + + - `"invalid_image_url"` + + - `"image_too_large"` + + - `"image_too_small"` + + - `"image_parse_error"` + + - `"image_content_policy_violation"` + + - `"invalid_image_mode"` + + - `"image_file_too_large"` + + - `"unsupported_image_media_type"` + + - `"empty_image_file"` + + - `"failed_to_download_image"` + + - `"image_file_not_found"` + + - `message: string` + + A human-readable description of the error. + + - `incomplete_details: object { reason }` + + Details about why the response is incomplete. + + - `reason: optional "max_output_tokens" or "content_filter"` + + The reason why the response is incomplete. + + - `"max_output_tokens"` + + - `"content_filter"` + + - `instructions: string or array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 27 more` + + A system (or developer) message inserted into the model's context. + + When using along with `previous_response_id`, the instructions from a previous + response will not be carried over to the next response. This makes it simple + to swap out system (or developer) messages in new responses. + + - `string` + + A text input to the model, equivalent to a text input with the + `developer` role. + + - `InputItemList = array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 27 more` + + A list of one or many input items to the model, containing + different content types. + + - `EasyInputMessage object { content, role, phase, type }` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + + - `content: string or ResponseInputMessageContentList` + + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + + - `TextInput = string` + + A text input to the model. + + - `ResponseInputMessageContentList = array of ResponseInputContent` + + A list of one or many input items to the model, containing different content + types. + + - `ResponseInputText object { text, type }` + + A text input to the model. + + - `text: string` + + The text input to the model. + + - `type: "input_text"` + + The type of the input item. Always `input_text`. + + - `"input_text"` + + - `ResponseInputImage object { detail, type, file_id, image_url }` + + An image input to the model. Learn about [image inputs](/docs/guides/vision). + + - `detail: "low" or "high" or "auto" or "original"` + + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + + - `"low"` + + - `"high"` + + - `"auto"` + + - `"original"` + + - `type: "input_image"` + + The type of the input item. Always `input_image`. + + - `"input_image"` + + - `file_id: optional string` + + The ID of the file to be sent to the model. + + - `image_url: optional string` + + 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, 3 more }` + + A file input to the model. + + - `type: "input_file"` + + The type of the input item. Always `input_file`. + + - `"input_file"` + + - `detail: optional "low" or "high"` + + The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`. + + - `"low"` + + - `"high"` + + - `file_data: optional string` + + The content of the file to be sent to the model. + + - `file_id: optional string` + + The ID of the file to be sent to the model. + + - `file_url: optional string` + + The URL of the file to be sent to the model. + + - `filename: optional string` + + The name of the file to be sent to the model. + + - `role: "user" or "assistant" or "system" or "developer"` + + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + + - `"user"` + + - `"assistant"` + + - `"system"` + + - `"developer"` + + - `phase: optional "commentary" or "final_answer"` + + 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. + + - `"commentary"` + + - `"final_answer"` + + - `type: optional "message"` + + The type of the message input. Always `message`. + + - `"message"` + + - `Message object { content, role, status, type }` + + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. + + - `content: ResponseInputMessageContentList` + + A list of one or many input items to the model, containing different content + types. + + - `role: "user" or "system" or "developer"` + + The role of the message input. One of `user`, `system`, or `developer`. + + - `"user"` + + - `"system"` + + - `"developer"` + + - `status: optional "in_progress" or "completed" or "incomplete"` + + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: optional "message"` + + The type of the message input. Always set to `message`. + + - `"message"` + + - `ResponseOutputMessage object { id, content, role, 3 more }` + + An output message from the model. + + - `id: string` + + The unique ID of the output message. + + - `content: array of ResponseOutputText or ResponseOutputRefusal` + + The content of the output message. + + - `ResponseOutputText object { annotations, logprobs, text, type }` + + A text output from the model. + + - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + + The annotations of the text output. + + - `FileCitation object { file_id, filename, index, type }` + + A citation to a file. + + - `file_id: string` + + The ID of the file. + + - `filename: string` + + The filename of the file cited. + + - `index: number` + + The index of the file in the list of files. + + - `type: "file_citation"` + + The type of the file citation. Always `file_citation`. + + - `"file_citation"` + + - `URLCitation object { end_index, start_index, title, 2 more }` + + A citation for a web resource used to generate a model response. + + - `end_index: number` + + The index of the last character of the URL citation in the message. + + - `start_index: number` + + The index of the first character of the URL citation in the message. + + - `title: string` + + The title of the web resource. + + - `type: "url_citation"` + + The type of the URL citation. Always `url_citation`. + + - `"url_citation"` + + - `url: string` + + The URL of the web resource. + + - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + + A citation for a container file used to generate a model response. + + - `container_id: string` + + The ID of the container file. + + - `end_index: number` + + The index of the last character of the container file citation in the message. + + - `file_id: string` + + The ID of the file. + + - `filename: string` + + The filename of the container file cited. + + - `start_index: number` + + The index of the first character of the container file citation in the message. + + - `type: "container_file_citation"` + + The type of the container file citation. Always `container_file_citation`. + + - `"container_file_citation"` + + - `FilePath object { file_id, index, type }` + + A path to a file. + + - `file_id: string` + + The ID of the file. - - `"required"` + - `index: number` - - `ToolChoiceAllowed object { mode, tools, type }` + The index of the file in the list of files. - Constrains the tools available to the model to a pre-defined set. + - `type: "file_path"` - - `mode: "auto" or "required"` + The type of the file path. Always `file_path`. - Constrains the tools available to the model to a pre-defined set. + - `"file_path"` - `auto` allows the model to pick from among the allowed tools and generate a - message. + - `logprobs: array of object { token, bytes, logprob, top_logprobs }` - `required` requires the model to call one or more of the allowed tools. + - `token: string` - - `"auto"` + - `bytes: array of number` - - `"required"` + - `logprob: number` - - `tools: array of map[unknown]` + - `top_logprobs: array of object { token, bytes, logprob }` - A list of tool definitions that the model should be allowed to call. + - `token: string` - For the Responses API, the list of tool definitions might look like: + - `bytes: array of number` - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` + - `logprob: number` - - `type: "allowed_tools"` + - `text: string` - Allowed tool configuration type. Always `allowed_tools`. + The text output from the model. - - `"allowed_tools"` + - `type: "output_text"` + + The type of the output text. Always `output_text`. + + - `"output_text"` + + - `ResponseOutputRefusal object { refusal, type }` + + A refusal from the model. + + - `refusal: string` + + The refusal explanation from the model. + + - `type: "refusal"` + + The type of the refusal. Always `refusal`. + + - `"refusal"` + + - `role: "assistant"` + + The role of the output message. Always `assistant`. + + - `"assistant"` + + - `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. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "message"` + + The type of the output message. Always `message`. + + - `"message"` + + - `phase: optional "commentary" or "final_answer"` + + 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. + + - `"commentary"` + + - `"final_answer"` + + - `FileSearchCall object { id, queries, status, 2 more }` + + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. + + - `id: string` + + The unique ID of the file search tool call. + + - `queries: array of string` + + The queries used to search for files. + + - `status: "in_progress" or "searching" or "completed" or 2 more` + + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + + - `"in_progress"` + + - `"searching"` + + - `"completed"` + + - `"incomplete"` + + - `"failed"` + + - `type: "file_search_call"` + + The type of the file search tool call. Always `file_search_call`. + + - `"file_search_call"` + + - `results: optional array of object { attributes, file_id, filename, 2 more }` + + The results of the file search tool call. + + - `attributes: optional map[string or number or boolean]` + + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. + + - `string` + + - `number` + + - `boolean` + + - `file_id: optional string` + + The unique ID of the file. + + - `filename: optional string` + + The name of the file. + + - `score: optional number` + + The relevance score of the file - a value between 0 and 1. + + - `text: optional string` + + The text that was retrieved from the file. + + - `ComputerCall object { id, call_id, pending_safety_checks, 4 more }` + + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. + + - `id: string` + + The unique ID of the computer call. + + - `call_id: string` + + An identifier used when responding to the tool call with output. + + - `pending_safety_checks: array of object { id, code, message }` + + The pending safety checks for the computer call. + + - `id: string` + + The ID of the pending safety check. + + - `code: optional string` + + The type of the pending safety check. + + - `message: optional string` + + Details about the pending safety check. + + - `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. + + - `"in_progress"` + + - `"completed"` + + - `"incomplete"` + + - `type: "computer_call"` + + The type of the computer call. Always `computer_call`. + + - `"computer_call"` + + - `action: optional ComputerAction` + + A click action. + + - `Click object { button, type, x, 2 more }` + + A click action. + + - `button: "left" or "right" or "wheel" or 2 more` + + Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + + - `"left"` + + - `"right"` + + - `"wheel"` + + - `"back"` + + - `"forward"` + + - `type: "click"` + + Specifies the event type. For a click action, this property is always `click`. + + - `"click"` + + - `x: number` + + The x-coordinate where the click occurred. + + - `y: number` + + The y-coordinate where the click occurred. + + - `keys: optional array of string` + + The keys being held while clicking. + + - `DoubleClick object { keys, type, x, y }` + + A double click action. + + - `keys: array of string` + + The keys being held while double-clicking. + + - `type: "double_click"` - - `ToolChoiceTypes object { type }` + Specifies the event type. For a double click action, this property is always set to `double_click`. - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](/docs/guides/tools). + - `"double_click"` - - `type: "file_search" or "web_search_preview" or "computer" or 5 more` + - `x: number` - The type of hosted tool the model should to use. Learn more about - [built-in tools](/docs/guides/tools). + The x-coordinate where the double click occurred. - Allowed values are: + - `y: number` - - `file_search` - - `web_search_preview` - - `computer` - - `computer_use_preview` - - `computer_use` - - `code_interpreter` - - `image_generation` + The y-coordinate where the double click occurred. - - `"file_search"` + - `Drag object { path, type, keys }` - - `"web_search_preview"` + A drag action. - - `"computer"` + - `path: array of object { x, y }` - - `"computer_use_preview"` + An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg - - `"computer_use"` + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` - - `"web_search_preview_2025_03_11"` + - `x: number` - - `"image_generation"` + The x-coordinate. - - `"code_interpreter"` + - `y: number` - - `ToolChoiceFunction object { name, type }` + The y-coordinate. - Use this option to force the model to call a specific function. + - `type: "drag"` - - `name: string` + Specifies the event type. For a drag action, this property is always set to `drag`. - The name of the function to call. + - `"drag"` - - `type: "function"` + - `keys: optional array of string` - For function calling, the type is always `function`. + The keys being held while dragging the mouse. - - `"function"` + - `Keypress object { keys, type }` - - `ToolChoiceMcp object { server_label, type, name }` + A collection of keypresses the model would like to perform. - Use this option to force the model to call a specific tool on a remote MCP server. + - `keys: array of string` - - `server_label: string` + The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - The label of the MCP server to use. + - `type: "keypress"` - - `type: "mcp"` + Specifies the event type. For a keypress action, this property is always set to `keypress`. - For MCP tools, the type is always `mcp`. + - `"keypress"` - - `"mcp"` + - `Move object { type, x, y, keys }` - - `name: optional string` + A mouse move action. - The name of the tool to call on the server. + - `type: "move"` - - `ToolChoiceCustom object { name, type }` + Specifies the event type. For a move action, this property is always set to `move`. - Use this option to force the model to call a specific custom tool. + - `"move"` - - `name: string` + - `x: number` - The name of the custom tool to call. + The x-coordinate to move to. - - `type: "custom"` + - `y: number` - For custom tool calling, the type is always `custom`. + The y-coordinate to move to. - - `"custom"` + - `keys: optional array of string` - - `ToolChoiceApplyPatch object { type }` + The keys being held while moving the mouse. - Forces the model to call the apply_patch tool when executing a tool call. + - `Screenshot object { type }` - - `type: "apply_patch"` + A screenshot action. - The tool to call. Always `apply_patch`. + - `type: "screenshot"` - - `"apply_patch"` + Specifies the event type. For a screenshot action, this property is always set to `screenshot`. - - `ToolChoiceShell object { type }` + - `"screenshot"` - Forces the model to call the shell tool when a tool call is required. + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `type: "shell"` + A scroll action. - The tool to call. Always `shell`. + - `scroll_x: number` - - `"shell"` + The horizontal scroll distance. -- `tools: optional array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` + - `scroll_y: number` - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. + The vertical scroll distance. - We support the following categories of tools: + - `type: "scroll"` - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](/docs/guides/tools-web-search) - or [file search](/docs/guides/tools-file-search). Learn more about - [built-in tools](/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](/docs/guides/function-calling). You can also use - custom tools to call your own code. + Specifies the event type. For a scroll action, this property is always set to `scroll`. - - `Function object { name, parameters, strict, 3 more }` + - `"scroll"` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + - `x: number` - - `name: string` + The x-coordinate where the scroll occurred. - The name of the function to call. + - `y: number` - - `parameters: map[unknown]` + The y-coordinate where the scroll occurred. - A JSON schema object describing the parameters of the function. + - `keys: optional array of string` - - `strict: boolean` + The keys being held while scrolling. - Whether to enforce strict parameter validation. Default `true`. + - `Type object { text, type }` - - `type: "function"` + An action to type in text. - The type of the function tool. Always `function`. + - `text: string` - - `"function"` + The text to type. - - `defer_loading: optional boolean` + - `type: "type"` - Whether this function is deferred and loaded via tool search. + Specifies the event type. For a type action, this property is always set to `type`. - - `description: optional string` + - `"type"` - A description of the function. Used by the model to determine whether or not to call the function. + - `Wait object { type }` - - `FileSearch object { type, vector_store_ids, filters, 2 more }` + A wait action. - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + - `type: "wait"` - - `type: "file_search"` + Specifies the event type. For a wait action, this property is always set to `wait`. - The type of the file search tool. Always `file_search`. + - `"wait"` - - `"file_search"` + - `actions: optional ComputerActionList` - - `vector_store_ids: array of string` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - The IDs of the vector stores to search. + - `Click object { button, type, x, 2 more }` - - `filters: optional ComparisonFilter or CompoundFilter` + A click action. - A filter to apply. + - `DoubleClick object { keys, type, x, y }` - - `ComparisonFilter object { key, type, value }` + A double click action. - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + - `Drag object { path, type, keys }` - - `CompoundFilter object { filters, type }` + A drag action. - Combine multiple filters using `and` or `or`. + - `Keypress object { keys, type }` - - `max_num_results: optional number` + A collection of keypresses the model would like to perform. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `Move object { type, x, y, keys }` - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + A mouse move action. - Ranking options for search. + - `Screenshot object { type }` - - `hybrid_search: optional object { embedding_weight, text_weight }` + A screenshot action. - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `Scroll object { scroll_x, scroll_y, type, 3 more }` - - `embedding_weight: number` + A scroll action. - The weight of the embedding in the reciprocal ranking fusion. + - `Type object { text, type }` - - `text_weight: number` + An action to type in text. - The weight of the text in the reciprocal ranking fusion. + - `Wait object { type }` - - `ranker: optional "auto" or "default-2024-11-15"` + A wait action. - The ranker to use for the file search. + - `ComputerCallOutput object { call_id, output, type, 3 more }` - - `"auto"` + The output of a computer tool call. - - `"default-2024-11-15"` + - `call_id: string` - - `score_threshold: optional number` + The ID of the computer tool call that produced the output. - 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. + - `output: ResponseComputerToolCallOutputScreenshot` - - `Computer object { type }` + A computer screenshot image used with the computer use tool. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `type: "computer_screenshot"` - - `type: "computer"` + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. - The type of the computer tool. Always `computer`. + - `"computer_screenshot"` - - `"computer"` + - `file_id: optional string` - - `ComputerUsePreview object { display_height, display_width, environment, type }` + The identifier of an uploaded file that contains the screenshot. - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `image_url: optional string` - - `display_height: number` + The URL of the screenshot image. - The height of the computer display. + - `type: "computer_call_output"` - - `display_width: number` + The type of the computer tool call output. Always `computer_call_output`. - The width of the computer display. + - `"computer_call_output"` - - `environment: "windows" or "mac" or "linux" or 2 more` + - `id: optional string` - The type of computer environment to control. + The ID of the computer tool call output. - - `"windows"` + - `acknowledged_safety_checks: optional array of object { id, code, message }` - - `"mac"` + The safety checks reported by the API that have been acknowledged by the developer. - - `"linux"` + - `id: string` - - `"ubuntu"` + The ID of the pending safety check. - - `"browser"` + - `code: optional string` - - `type: "computer_use_preview"` + The type of the pending safety check. - The type of the computer use tool. Always `computer_use_preview`. + - `message: optional string` - - `"computer_use_preview"` + Details about the pending safety check. - - `WebSearch object { type, filters, search_context_size, user_location }` + - `status: optional "in_progress" or "completed" or "incomplete"` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). + The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. - - `type: "web_search" or "web_search_2025_08_26"` + - `"in_progress"` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + - `"completed"` - - `"web_search"` + - `"incomplete"` - - `"web_search_2025_08_26"` + - `WebSearchCall object { id, action, status, type }` - - `filters: optional object { allowed_domains }` + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. - Filters for the search. + - `id: string` - - `allowed_domains: optional array of string` + The unique ID of the web search tool call. - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find_in_page). - - `search_context_size: optional "low" or "medium" or "high"` + - `Search object { type, queries, query, sources }` - 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. + Action type "search" - Performs a web search query. - - `"low"` + - `type: "search"` - - `"medium"` + The action type. - - `"high"` + - `"search"` - - `user_location: optional object { city, country, region, 2 more }` + - `queries: optional array of string` - The approximate location of the user. + The search queries. - - `city: optional string` + - `query: optional string` - Free text input for the city of the user, e.g. `San Francisco`. + The search query. - - `country: optional string` + - `sources: optional array of object { type, url }` - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + The sources used in the search. - - `region: optional string` + - `type: "url"` - Free text input for the region of the user, e.g. `California`. + The type of source. Always `url`. - - `timezone: optional string` + - `"url"` - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `url: string` - - `type: optional "approximate"` + The URL of the source. - The type of location approximation. Always `approximate`. + - `OpenPage object { type, url }` - - `"approximate"` + Action type "open_page" - Opens a specific URL from search results. - - `Mcp object { server_label, type, allowed_tools, 7 more }` + - `type: "open_page"` - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). + The action type. - - `server_label: string` + - `"open_page"` - A label for this MCP server, used to identify it in tool calls. + - `url: optional string` - - `type: "mcp"` + The URL opened by the model. - The type of the MCP tool. Always `mcp`. + - `FindInPage object { pattern, type, url }` - - `"mcp"` + Action type "find_in_page": Searches for a pattern within a loaded page. - - `allowed_tools: optional array of string or object { read_only, tool_names }` + - `pattern: string` - List of allowed tool names or a filter object. + The pattern or text to search for within the page. - - `McpAllowedTools = array of string` + - `type: "find_in_page"` - A string array of allowed tool names + The action type. - - `McpToolFilter object { read_only, tool_names }` + - `"find_in_page"` - A filter object to specify which tools are allowed. + - `url: string` - - `read_only: optional boolean` + The URL of the page searched for the pattern. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `status: "in_progress" or "searching" or "completed" or "failed"` - - `tool_names: optional array of string` + The status of the web search tool call. - List of allowed tool names. + - `"in_progress"` - - `authorization: optional string` + - `"searching"` - 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. + - `"completed"` - - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` + - `"failed"` - Identifier for service connectors, like those available in ChatGPT. One of - `server_url` or `connector_id` must be provided. Learn more about service - connectors [here](/docs/guides/tools-remote-mcp#connectors). + - `type: "web_search_call"` - Currently supported `connector_id` values are: + The type of the web search tool call. Always `web_search_call`. - - 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` + - `"web_search_call"` - - `"connector_dropbox"` + - `FunctionCall object { arguments, call_id, name, 4 more }` - - `"connector_gmail"` + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - - `"connector_googlecalendar"` + - `arguments: string` - - `"connector_googledrive"` + A JSON string of the arguments to pass to the function. - - `"connector_microsoftteams"` + - `call_id: string` - - `"connector_outlookcalendar"` + The unique ID of the function tool call generated by the model. - - `"connector_outlookemail"` + - `name: string` - - `"connector_sharepoint"` + The name of the function to run. - - `defer_loading: optional boolean` + - `type: "function_call"` - Whether this MCP tool is deferred and discovered via tool search. + The type of the function tool call. Always `function_call`. - - `headers: optional map[string]` + - `"function_call"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `id: optional string` - - `require_approval: optional object { always, never } or "always" or "never"` + The unique ID of the function tool call. - Specify which of the MCP server's tools require approval. + - `namespace: optional string` - - `McpToolApprovalFilter object { always, never }` + The namespace of the function to run. - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `always: optional object { read_only, tool_names }` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - A filter object to specify which tools are allowed. + - `"in_progress"` - - `read_only: optional boolean` + - `"completed"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `"incomplete"` - - `tool_names: optional array of string` + - `FunctionCallOutput object { call_id, output, type, 2 more }` - List of allowed tool names. + The output of a function tool call. - - `never: optional object { read_only, tool_names }` + - `call_id: string` - A filter object to specify which tools are allowed. + The unique ID of the function tool call generated by the model. - - `read_only: optional boolean` + - `output: string or array of ResponseInputTextContent or ResponseInputImageContent or ResponseInputFileContent` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + Text, image, or file output of the function tool call. - - `tool_names: optional array of string` + - `string` - List of allowed tool names. + A JSON string of the output of the function tool call. - - `McpToolApprovalSetting = "always" or "never"` + - `array of ResponseInputTextContent or ResponseInputImageContent or ResponseInputFileContent` - 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. + An array of content outputs (text, image, file) for the function tool call. - - `"always"` + - `ResponseInputTextContent object { text, type }` - - `"never"` + A text input to the model. - - `server_description: optional string` + - `text: string` - Optional description of the MCP server, used to provide more context. + The text input to the model. - - `server_url: optional string` + - `type: "input_text"` - The URL for the MCP server. One of `server_url` or `connector_id` must be - provided. + The type of the input item. Always `input_text`. - - `CodeInterpreter object { container, type }` + - `"input_text"` - A tool that runs Python code to help generate a response to a prompt. + - `ResponseInputImageContent object { type, detail, file_id, image_url }` - - `container: string or object { type, file_ids, memory_limit, network_policy }` + An image input to the model. Learn about [image inputs](/docs/guides/vision) - 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. + - `type: "input_image"` - - `string` + The type of the input item. Always `input_image`. - The container ID. + - `"input_image"` - - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` + - `detail: optional "low" or "high" or "auto" or "original"` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. - - `type: "auto"` + - `"low"` - Always `auto`. + - `"high"` - `"auto"` - - `file_ids: optional array of string` + - `"original"` - An optional list of uploaded files to make available to your code. + - `file_id: optional string` - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + The ID of the file to be sent to the model. - The memory limit for the code interpreter container. + - `image_url: optional string` - - `"1g"` + The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. - - `"4g"` + - `ResponseInputFileContent object { type, detail, file_data, 3 more }` - - `"16g"` + A file input to the model. - - `"64g"` + - `type: "input_file"` - - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` + The type of the input item. Always `input_file`. - Network access policy for the container. + - `"input_file"` - - `ContainerNetworkPolicyDisabled object { type }` + - `detail: optional "low" or "high"` - - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`. - - `type: "code_interpreter"` + - `"low"` + + - `"high"` + + - `file_data: optional string` - The type of the code interpreter tool. Always `code_interpreter`. + The base64-encoded data of the file to be sent to the model. - - `"code_interpreter"` + - `file_id: optional string` - - `ImageGeneration object { type, action, background, 9 more }` + The ID of the file to be sent to the model. - A tool that generates images using the GPT image models. + - `file_url: optional string` - - `type: "image_generation"` + The URL of the file to be sent to the model. - The type of the image generation tool. Always `image_generation`. + - `filename: optional string` - - `"image_generation"` + The name of the file to be sent to the model. - - `action: optional "generate" or "edit" or "auto"` + - `type: "function_call_output"` - Whether to generate a new image or edit an existing image. Default: `auto`. + The type of the function tool call output. Always `function_call_output`. - - `"generate"` + - `"function_call_output"` - - `"edit"` + - `id: optional string` - - `"auto"` + The unique ID of the function tool call output. Populated when this item is returned via API. - - `background: optional "transparent" or "opaque" or "auto"` + - `status: optional "in_progress" or "completed" or "incomplete"` - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - - `"transparent"` + - `"in_progress"` - - `"opaque"` + - `"completed"` - - `"auto"` + - `"incomplete"` - - `input_fidelity: optional "high" or "low"` + - `ToolSearchCall object { arguments, type, id, 3 more }` - 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`. + - `arguments: unknown` - - `"high"` + The arguments supplied to the tool search call. - - `"low"` + - `type: "tool_search_call"` - - `input_image_mask: optional object { file_id, image_url }` + The item type. Always `tool_search_call`. - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `"tool_search_call"` - - `file_id: optional string` + - `id: optional string` - File ID for the mask image. + The unique ID of this tool search call. - - `image_url: optional string` + - `call_id: optional string` - Base64-encoded mask image. + The unique ID of the tool search call generated by the model. - - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `execution: optional "server" or "client"` - The image generation model to use. Default: `gpt-image-1`. + Whether tool search was executed by the server or by the client. - - `string` + - `"server"` - - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `"client"` - The image generation model to use. Default: `gpt-image-1`. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"gpt-image-1"` + The status of the tool search call. - - `"gpt-image-1-mini"` + - `"in_progress"` - - `"gpt-image-1.5"` + - `"completed"` - - `moderation: optional "auto" or "low"` + - `"incomplete"` - Moderation level for the generated image. Default: `auto`. + - `ToolSearchOutput object { tools, type, id, 3 more }` - - `"auto"` + - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` - - `"low"` + The loaded tool definitions returned by the tool search output. - - `output_compression: optional number` + - `Function object { name, parameters, strict, 3 more }` - Compression level for the output image. Default: 100. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `output_format: optional "png" or "webp" or "jpeg"` + - `name: string` - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + The name of the function to call. - - `"png"` + - `parameters: map[unknown]` - - `"webp"` + A JSON schema object describing the parameters of the function. - - `"jpeg"` + - `strict: boolean` - - `partial_images: optional number` + Whether to enforce strict parameter validation. Default `true`. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `type: "function"` - - `quality: optional "low" or "medium" or "high" or "auto"` + The type of the function tool. Always `function`. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `"function"` - - `"low"` + - `defer_loading: optional boolean` - - `"medium"` + Whether this function is deferred and loaded via tool search. - - `"high"` + - `description: optional string` - - `"auto"` + A description of the function. Used by the model to determine whether or not to call the function. - - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - 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 searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `string` + - `type: "file_search"` - - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` + The type of the file search tool. Always `file_search`. - 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`. + - `"file_search"` - - `"1024x1024"` + - `vector_store_ids: array of string` - - `"1024x1536"` + The IDs of the vector stores to search. - - `"1536x1024"` + - `filters: optional ComparisonFilter or CompoundFilter` - - `"auto"` + A filter to apply. - - `LocalShell object { type }` + - `ComparisonFilter object { key, type, value }` - A tool that allows the model to execute shell commands in a local environment. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `type: "local_shell"` + - `key: string` - The type of the local shell tool. Always `local_shell`. + The key to compare against the value. - - `"local_shell"` + - `type: "eq" or "ne" or "gt" or 5 more` - - `Shell object { type, environment }` + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - A tool that allows the model to execute shell commands. + - `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 - - `type: "shell"` + - `"eq"` - The type of the shell tool. Always `shell`. + - `"ne"` - - `"shell"` + - `"gt"` - - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` + - `"gte"` - - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` + - `"lt"` - - `LocalEnvironment object { type, skills }` + - `"lte"` - - `ContainerReference object { container_id, type }` + - `"in"` - - `Custom object { name, type, defer_loading, 2 more }` + - `"nin"` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + - `value: string or number or boolean or array of string or number` - - `name: string` + The value to compare against the attribute key; supports string, number, or boolean types. - The name of the custom tool, used to identify it in tool calls. + - `string` - - `type: "custom"` + - `number` - The type of the custom tool. Always `custom`. + - `boolean` - - `"custom"` + - `array of string or number` - - `defer_loading: optional boolean` + - `string` - Whether this tool should be deferred and discovered via tool search. + - `number` - - `description: optional string` + - `CompoundFilter object { filters, type }` - Optional description of the custom tool, used to provide more context. + Combine multiple filters using `and` or `or`. - - `format: optional CustomToolInputFormat` + - `filters: array of ComparisonFilter or unknown` - The input format for the custom tool. Default is unconstrained text. + Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - - `Namespace object { description, name, tools, type }` + - `ComparisonFilter object { key, type, value }` - Groups function/custom tools under a shared namespace. + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `description: string` + - `unknown` - A description of the namespace shown to the model. + - `type: "and" or "or"` - - `name: string` + Type of operation: `and` or `or`. - The namespace name used in tool calls (for example, `crm`). + - `"and"` - - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` + - `"or"` - The function/custom tools available inside this namespace. + - `max_num_results: optional number` - - `Function object { name, type, defer_loading, 3 more }` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `name: string` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - `type: "function"` + Ranking options for search. - - `"function"` + - `hybrid_search: optional object { embedding_weight, text_weight }` - - `defer_loading: optional boolean` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - Whether this function should be deferred and discovered via tool search. + - `embedding_weight: number` - - `description: optional string` + The weight of the embedding in the reciprocal ranking fusion. - - `parameters: optional unknown` + - `text_weight: number` - - `strict: optional boolean` + The weight of the text in the reciprocal ranking fusion. - - `Custom object { name, type, defer_loading, 2 more }` + - `ranker: optional "auto" or "default-2024-11-15"` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + The ranker to use for the file search. - - `name: string` + - `"auto"` - The name of the custom tool, used to identify it in tool calls. + - `"default-2024-11-15"` - - `type: "custom"` + - `score_threshold: optional number` - The type of the custom tool. Always `custom`. + 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. - - `"custom"` + - `Computer object { type }` - - `defer_loading: optional boolean` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - Whether this tool should be deferred and discovered via tool search. + - `type: "computer"` - - `description: optional string` + The type of the computer tool. Always `computer`. - Optional description of the custom tool, used to provide more context. + - `"computer"` - - `format: optional CustomToolInputFormat` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - The input format for the custom tool. Default is unconstrained text. + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `type: "namespace"` + - `display_height: number` - The type of the tool. Always `namespace`. + The height of the computer display. - - `"namespace"` + - `display_width: number` - - `ToolSearch object { type, description, execution, parameters }` + The width of the computer display. - Hosted or BYOT tool search configuration for deferred tools. + - `environment: "windows" or "mac" or "linux" or 2 more` - - `type: "tool_search"` + The type of computer environment to control. - The type of the tool. Always `tool_search`. + - `"windows"` - - `"tool_search"` + - `"mac"` - - `description: optional string` + - `"linux"` - Description shown to the model for a client-executed tool search tool. + - `"ubuntu"` - - `execution: optional "server" or "client"` + - `"browser"` - Whether tool search is executed by the server or by the client. + - `type: "computer_use_preview"` - - `"server"` + The type of the computer use tool. Always `computer_use_preview`. - - `"client"` + - `"computer_use_preview"` - - `parameters: optional unknown` + - `WebSearch object { type, filters, search_context_size, user_location }` - Parameter schema for a client-executed tool search tool. + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + - `type: "web_search" or "web_search_2025_08_26"` - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + - `"web_search"` - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `"web_search_2025_08_26"` - - `"web_search_preview"` + - `filters: optional object { allowed_domains }` - - `"web_search_preview_2025_03_11"` + Filters for the search. - - `search_content_types: optional array of "text" or "image"` + - `allowed_domains: optional array of string` - - `"text"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `"image"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - `search_context_size: optional "low" or "medium" or "high"` @@ -4265,15 +6477,9 @@ as input for the model's response. - `"high"` - - `user_location: optional object { type, city, country, 2 more }` - - The user's location. - - - `type: "approximate"` - - The type of location approximation. Always `approximate`. + - `user_location: optional object { city, country, region, 2 more }` - - `"approximate"` + The approximate location of the user. - `city: optional string` @@ -4291,1431 +6497,1445 @@ as input for the model's response. The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `ApplyPatch object { type }` + - `type: optional "approximate"` - Allows the assistant to create, delete, or update files using unified diffs. + The type of location approximation. Always `approximate`. - - `type: "apply_patch"` + - `"approximate"` - The type of the tool. Always `apply_patch`. + - `Mcp object { server_label, type, allowed_tools, 7 more }` - - `"apply_patch"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). -- `top_logprobs: optional number` + - `server_label: string` - An integer between 0 and 20 specifying the maximum number of most likely - tokens to return at each token position, each with an associated log - probability. In some cases, the number of returned tokens may be fewer than - requested. + A label for this MCP server, used to identify it in tool calls. -- `top_p: optional number` + - `type: "mcp"` - An alternative to sampling with temperature, called nucleus sampling, - where the model considers the results of the tokens with top_p probability - mass. So 0.1 means only the tokens comprising the top 10% probability mass - are considered. + The type of the MCP tool. Always `mcp`. - We generally recommend altering this or `temperature` but not both. + - `"mcp"` -- `truncation: optional "auto" or "disabled"` + - `allowed_tools: optional array of string or object { read_only, tool_names }` - The truncation strategy to use for the model response. + List of allowed tool names or a filter object. - - `auto`: If the input to this Response exceeds - the model's context window size, the model will truncate the - response to fit the context window by dropping items from the beginning of the conversation. - - `disabled` (default): If the input size will exceed the context window - size for a model, the request will fail with a 400 error. + - `McpAllowedTools = array of string` - - `"auto"` + A string array of allowed tool names - - `"disabled"` + - `McpToolFilter object { read_only, tool_names }` -- `user: optional string` + A filter object to specify which tools are allowed. - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](/docs/guides/safety-best-practices#safety-identifiers). + - `read_only: optional boolean` -### Returns + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. -- `Response object { id, created_at, error, 30 more }` + - `tool_names: optional array of string` - - `id: string` + List of allowed tool names. - Unique identifier for this Response. + - `authorization: optional string` - - `created_at: number` + 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. - Unix timestamp (in seconds) of when this Response was created. + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - `error: ResponseError` + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](/docs/guides/tools-remote-mcp#connectors). - An error object returned when the model fails to generate a Response. + Currently supported `connector_id` values are: - - `code: "server_error" or "rate_limit_exceeded" or "invalid_prompt" or 15 more` + - 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` - The error code for the response. + - `"connector_dropbox"` - - `"server_error"` + - `"connector_gmail"` - - `"rate_limit_exceeded"` + - `"connector_googlecalendar"` - - `"invalid_prompt"` + - `"connector_googledrive"` - - `"vector_store_timeout"` + - `"connector_microsoftteams"` - - `"invalid_image"` + - `"connector_outlookcalendar"` - - `"invalid_image_format"` + - `"connector_outlookemail"` - - `"invalid_base64_image"` + - `"connector_sharepoint"` - - `"invalid_image_url"` + - `defer_loading: optional boolean` - - `"image_too_large"` + Whether this MCP tool is deferred and discovered via tool search. - - `"image_too_small"` + - `headers: optional map[string]` - - `"image_parse_error"` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `"image_content_policy_violation"` + - `require_approval: optional object { always, never } or "always" or "never"` - - `"invalid_image_mode"` + Specify which of the MCP server's tools require approval. - - `"image_file_too_large"` + - `McpToolApprovalFilter object { always, never }` - - `"unsupported_image_media_type"` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `"empty_image_file"` + - `always: optional object { read_only, tool_names }` - - `"failed_to_download_image"` + A filter object to specify which tools are allowed. - - `"image_file_not_found"` + - `read_only: optional boolean` - - `message: string` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - A human-readable description of the error. + - `tool_names: optional array of string` - - `incomplete_details: object { reason }` + List of allowed tool names. - Details about why the response is incomplete. + - `never: optional object { read_only, tool_names }` - - `reason: optional "max_output_tokens" or "content_filter"` + A filter object to specify which tools are allowed. - The reason why the response is incomplete. + - `read_only: optional boolean` - - `"max_output_tokens"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `"content_filter"` + - `tool_names: optional array of string` - - `instructions: string or array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 26 more` + List of allowed tool names. - A system (or developer) message inserted into the model's context. + - `McpToolApprovalSetting = "always" or "never"` - When using along with `previous_response_id`, the instructions from a previous - response will not be carried over to the next response. This makes it simple - to swap out system (or developer) messages in new responses. + 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. - - `string` + - `"always"` - A text input to the model, equivalent to a text input with the - `developer` role. + - `"never"` - - `InputItemList = array of EasyInputMessage or object { content, role, status, type } or ResponseOutputMessage or 26 more` + - `server_description: optional string` - A list of one or many input items to the model, containing - different content types. + Optional description of the MCP server, used to provide more context. - - `EasyInputMessage object { content, role, phase, type }` + - `server_url: optional string` - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. - - `content: string or ResponseInputMessageContentList` + - `CodeInterpreter object { container, type }` - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. + A tool that runs Python code to help generate a response to a prompt. - - `TextInput = string` + - `container: string or object { type, file_ids, memory_limit, network_policy }` - A text input to the model. + 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. - - `ResponseInputMessageContentList = array of ResponseInputContent` + - `string` - A list of one or many input items to the model, containing different content - types. + The container ID. - - `ResponseInputText object { text, type }` + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - A text input to the model. + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + + - `type: "auto"` + + Always `auto`. + + - `"auto"` + + - `file_ids: optional array of string` + + An optional list of uploaded files to make available to your code. + + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `text: string` + The memory limit for the code interpreter container. - The text input to the model. + - `"1g"` - - `type: "input_text"` + - `"4g"` - The type of the input item. Always `input_text`. + - `"16g"` - - `"input_text"` + - `"64g"` - - `ResponseInputImage object { detail, type, file_id, image_url }` + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + Network access policy for the container. - - `detail: "low" or "high" or "auto" or "original"` + - `ContainerNetworkPolicyDisabled object { type }` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + - `type: "disabled"` - - `"low"` + Disable outbound network access. Always `disabled`. - - `"high"` + - `"disabled"` - - `"auto"` + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `"original"` + - `allowed_domains: array of string` - - `type: "input_image"` + A list of allowed domains when type is `allowlist`. - The type of the input item. Always `input_image`. + - `type: "allowlist"` - - `"input_image"` + Allow outbound network access only to specified domains. Always `allowlist`. - - `file_id: optional string` + - `"allowlist"` - The ID of the file to be sent to the model. + - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret` - - `image_url: optional string` + Optional domain-scoped secrets for allowlisted domains. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `domain: string` - - `ResponseInputFile object { type, detail, file_data, 3 more }` + The domain associated with the secret. - A file input to the model. + - `name: string` - - `type: "input_file"` + The name of the secret to inject for the domain. - The type of the input item. Always `input_file`. + - `value: string` - - `"input_file"` + The secret value to inject for the domain. - - `detail: optional "low" or "high"` + - `type: "code_interpreter"` - The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`. + The type of the code interpreter tool. Always `code_interpreter`. - - `"low"` + - `"code_interpreter"` - - `"high"` + - `ImageGeneration object { type, action, background, 9 more }` - - `file_data: optional string` + A tool that generates images using the GPT image models. - The content of the file to be sent to the model. + - `type: "image_generation"` - - `file_id: optional string` + The type of the image generation tool. Always `image_generation`. - The ID of the file to be sent to the model. + - `"image_generation"` - - `file_url: optional string` + - `action: optional "generate" or "edit" or "auto"` - The URL of the file to be sent to the model. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `filename: optional string` + - `"generate"` - The name of the file to be sent to the model. + - `"edit"` - - `role: "user" or "assistant" or "system" or "developer"` + - `"auto"` - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. + - `background: optional "transparent" or "opaque" or "auto"` - - `"user"` + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - - `"assistant"` + - `"transparent"` - - `"system"` + - `"opaque"` - - `"developer"` + - `"auto"` - - `phase: optional "commentary" or "final_answer"` + - `input_fidelity: optional "high" or "low"` - 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. + 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`. - - `"commentary"` + - `"high"` - - `"final_answer"` + - `"low"` - - `type: optional "message"` + - `input_image_mask: optional object { file_id, image_url }` - The type of the message input. Always `message`. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `"message"` + - `file_id: optional string` - - `Message object { content, role, status, type }` + File ID for the mask image. - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. + - `image_url: optional string` - - `content: ResponseInputMessageContentList` + Base64-encoded mask image. - A list of one or many input items to the model, containing different content - types. + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `role: "user" or "system" or "developer"` + The image generation model to use. Default: `gpt-image-1`. - The role of the message input. One of `user`, `system`, or `developer`. + - `string` - - `"user"` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `"system"` + The image generation model to use. Default: `gpt-image-1`. - - `"developer"` + - `"gpt-image-1"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"gpt-image-1-mini"` - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"gpt-image-1.5"` - - `"in_progress"` + - `moderation: optional "auto" or "low"` - - `"completed"` + Moderation level for the generated image. Default: `auto`. - - `"incomplete"` + - `"auto"` - - `type: optional "message"` + - `"low"` - The type of the message input. Always set to `message`. + - `output_compression: optional number` - - `"message"` + Compression level for the output image. Default: 100. - - `ResponseOutputMessage object { id, content, role, 3 more }` + - `output_format: optional "png" or "webp" or "jpeg"` - An output message from the model. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `id: string` + - `"png"` - The unique ID of the output message. + - `"webp"` - - `content: array of ResponseOutputText or ResponseOutputRefusal` + - `"jpeg"` - The content of the output message. + - `partial_images: optional number` - - `ResponseOutputText object { annotations, logprobs, text, type }` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - A text output from the model. + - `quality: optional "low" or "medium" or "high" or "auto"` - - `annotations: array of object { file_id, filename, index, type } or object { end_index, start_index, title, 2 more } or object { container_id, end_index, file_id, 3 more } or object { file_id, index, type }` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - The annotations of the text output. + - `"low"` - - `FileCitation object { file_id, filename, index, type }` + - `"medium"` - A citation to a file. + - `"high"` - - `file_id: string` + - `"auto"` - The ID of the file. + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `filename: string` + 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`. - The filename of the file cited. + - `string` - - `index: number` + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The index of the file in the list of files. + 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`. - - `type: "file_citation"` + - `"1024x1024"` - The type of the file citation. Always `file_citation`. + - `"1024x1536"` - - `"file_citation"` + - `"1536x1024"` - - `URLCitation object { end_index, start_index, title, 2 more }` + - `"auto"` - A citation for a web resource used to generate a model response. + - `LocalShell object { type }` - - `end_index: number` + A tool that allows the model to execute shell commands in a local environment. - The index of the last character of the URL citation in the message. + - `type: "local_shell"` - - `start_index: number` + The type of the local shell tool. Always `local_shell`. - The index of the first character of the URL citation in the message. + - `"local_shell"` - - `title: string` + - `Shell object { type, environment }` - The title of the web resource. + A tool that allows the model to execute shell commands. - - `type: "url_citation"` + - `type: "shell"` - The type of the URL citation. Always `url_citation`. + The type of the shell tool. Always `shell`. - - `"url_citation"` + - `"shell"` - - `url: string` + - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` - The URL of the web resource. + - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `ContainerFileCitation object { container_id, end_index, file_id, 3 more }` + - `type: "container_auto"` - A citation for a container file used to generate a model response. + Automatically creates a container for this request - - `container_id: string` + - `"container_auto"` - The ID of the container file. + - `file_ids: optional array of string` - - `end_index: number` + An optional list of uploaded files to make available to your code. - The index of the last character of the container file citation in the message. + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `file_id: string` + The memory limit for the container. - The ID of the file. + - `"1g"` - - `filename: string` + - `"4g"` - The filename of the container file cited. + - `"16g"` - - `start_index: number` + - `"64g"` - The index of the first character of the container file citation in the message. + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` - - `type: "container_file_citation"` + Network access policy for the container. - The type of the container file citation. Always `container_file_citation`. + - `ContainerNetworkPolicyDisabled object { type }` - - `"container_file_citation"` + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `FilePath object { file_id, index, type }` + - `skills: optional array of SkillReference or InlineSkill` - A path to a file. + An optional list of skills referenced by id or inline data. - - `file_id: string` + - `SkillReference object { skill_id, type, version }` - The ID of the file. + - `skill_id: string` - - `index: number` + The ID of the referenced skill. - The index of the file in the list of files. + - `type: "skill_reference"` - - `type: "file_path"` + References a skill created with the /v1/skills endpoint. - The type of the file path. Always `file_path`. + - `"skill_reference"` - - `"file_path"` + - `version: optional string` - - `logprobs: array of object { token, bytes, logprob, top_logprobs }` + Optional skill version. Use a positive integer or 'latest'. Omit for default. - - `token: string` + - `InlineSkill object { description, name, source, type }` - - `bytes: array of number` + - `description: string` - - `logprob: number` + The description of the skill. - - `top_logprobs: array of object { token, bytes, logprob }` + - `name: string` - - `token: string` + The name of the skill. - - `bytes: array of number` + - `source: InlineSkillSource` - - `logprob: number` + Inline skill payload - - `text: string` + - `data: string` - The text output from the model. + Base64-encoded skill zip bundle. - - `type: "output_text"` + - `media_type: "application/zip"` - The type of the output text. Always `output_text`. + The media type of the inline skill payload. Must be `application/zip`. - - `"output_text"` + - `"application/zip"` - - `ResponseOutputRefusal object { refusal, type }` + - `type: "base64"` - A refusal from the model. + The type of the inline skill source. Must be `base64`. - - `refusal: string` + - `"base64"` - The refusal explanation from the model. + - `type: "inline"` - - `type: "refusal"` + Defines an inline skill for this request. - The type of the refusal. Always `refusal`. + - `"inline"` - - `"refusal"` + - `LocalEnvironment object { type, skills }` - - `role: "assistant"` + - `type: "local"` - The role of the output message. Always `assistant`. + Use a local computer environment. - - `"assistant"` + - `"local"` - - `status: "in_progress" or "completed" or "incomplete"` + - `skills: optional array of LocalSkill` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + An optional list of skills. - - `"in_progress"` + - `description: string` - - `"completed"` + The description of the skill. - - `"incomplete"` + - `name: string` - - `type: "message"` + The name of the skill. - The type of the output message. Always `message`. + - `path: string` - - `"message"` + The path to the directory containing the skill. - - `phase: optional "commentary" or "final_answer"` + - `ContainerReference object { container_id, type }` - 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. + - `container_id: string` - - `"commentary"` + The ID of the referenced container. - - `"final_answer"` + - `type: "container_reference"` - - `FileSearchCall object { id, queries, status, 2 more }` + References a container created with the /v1/containers endpoint - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + - `"container_reference"` - - `id: string` + - `Custom object { name, type, defer_loading, 2 more }` - The unique ID of the file search tool call. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `queries: array of string` + - `name: string` - The queries used to search for files. + The name of the custom tool, used to identify it in tool calls. - - `status: "in_progress" or "searching" or "completed" or 2 more` + - `type: "custom"` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + The type of the custom tool. Always `custom`. - - `"in_progress"` + - `"custom"` - - `"searching"` + - `defer_loading: optional boolean` - - `"completed"` + Whether this tool should be deferred and discovered via tool search. - - `"incomplete"` + - `description: optional string` - - `"failed"` + Optional description of the custom tool, used to provide more context. - - `type: "file_search_call"` + - `format: optional CustomToolInputFormat` - The type of the file search tool call. Always `file_search_call`. + The input format for the custom tool. Default is unconstrained text. - - `"file_search_call"` + - `Text object { type }` - - `results: optional array of object { attributes, file_id, filename, 2 more }` + Unconstrained free-form text. - The results of the file search tool call. + - `type: "text"` - - `attributes: optional map[string or number or boolean]` + Unconstrained text format. Always `text`. - 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. + - `"text"` - - `string` + - `Grammar object { definition, syntax, type }` - - `number` + A grammar defined by the user. - - `boolean` + - `definition: string` - - `file_id: optional string` + The grammar definition. - The unique ID of the file. + - `syntax: "lark" or "regex"` - - `filename: optional string` + The syntax of the grammar definition. One of `lark` or `regex`. - The name of the file. + - `"lark"` - - `score: optional number` + - `"regex"` - The relevance score of the file - a value between 0 and 1. + - `type: "grammar"` - - `text: optional string` + Grammar format. Always `grammar`. - The text that was retrieved from the file. + - `"grammar"` - - `ComputerCall object { id, call_id, pending_safety_checks, 4 more }` + - `Namespace object { description, name, tools, type }` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + Groups function/custom tools under a shared namespace. - - `id: string` + - `description: string` - The unique ID of the computer call. + A description of the namespace shown to the model. - - `call_id: string` + - `name: string` - An identifier used when responding to the tool call with output. + The namespace name used in tool calls (for example, `crm`). - - `pending_safety_checks: array of object { id, code, message }` + - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` - The pending safety checks for the computer call. + The function/custom tools available inside this namespace. - - `id: string` + - `Function object { name, type, defer_loading, 3 more }` - The ID of the pending safety check. + - `name: string` - - `code: optional string` + - `type: "function"` - The type of the pending safety check. + - `"function"` - - `message: optional string` + - `defer_loading: optional boolean` - Details about the pending safety check. + Whether this function should be deferred and discovered via tool search. - - `status: "in_progress" or "completed" or "incomplete"` + - `description: optional string` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `parameters: optional unknown` - - `"in_progress"` + - `strict: optional boolean` - - `"completed"` + - `Custom object { name, type, defer_loading, 2 more }` - - `"incomplete"` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `type: "computer_call"` + - `name: string` - The type of the computer call. Always `computer_call`. + The name of the custom tool, used to identify it in tool calls. - - `"computer_call"` + - `type: "custom"` - - `action: optional ComputerAction` + The type of the custom tool. Always `custom`. - A click action. + - `"custom"` - - `Click object { button, type, x, 2 more }` + - `defer_loading: optional boolean` - A click action. + Whether this tool should be deferred and discovered via tool search. - - `button: "left" or "right" or "wheel" or 2 more` + - `description: optional string` - Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + Optional description of the custom tool, used to provide more context. - - `"left"` + - `format: optional CustomToolInputFormat` - - `"right"` + The input format for the custom tool. Default is unconstrained text. - - `"wheel"` + - `type: "namespace"` - - `"back"` + The type of the tool. Always `namespace`. - - `"forward"` + - `"namespace"` - - `type: "click"` + - `ToolSearch object { type, description, execution, parameters }` - Specifies the event type. For a click action, this property is always `click`. + Hosted or BYOT tool search configuration for deferred tools. - - `"click"` + - `type: "tool_search"` - - `x: number` + The type of the tool. Always `tool_search`. - The x-coordinate where the click occurred. + - `"tool_search"` - - `y: number` + - `description: optional string` - The y-coordinate where the click occurred. + Description shown to the model for a client-executed tool search tool. - - `keys: optional array of string` + - `execution: optional "server" or "client"` - The keys being held while clicking. + Whether tool search is executed by the server or by the client. - - `DoubleClick object { keys, type, x, y }` + - `"server"` - A double click action. + - `"client"` - - `keys: array of string` + - `parameters: optional unknown` - The keys being held while double-clicking. + Parameter schema for a client-executed tool search tool. - - `type: "double_click"` + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - Specifies the event type. For a double click action, this property is always set to `double_click`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `"double_click"` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - `x: number` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - The x-coordinate where the double click occurred. + - `"web_search_preview"` - - `y: number` + - `"web_search_preview_2025_03_11"` - The y-coordinate where the double click occurred. + - `search_content_types: optional array of "text" or "image"` - - `Drag object { path, type, keys }` + - `"text"` - A drag action. + - `"image"` - - `path: array of object { x, y }` + - `search_context_size: optional "low" or "medium" or "high"` - An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg + 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. - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` + - `"low"` - - `x: number` + - `"medium"` - The x-coordinate. + - `"high"` - - `y: number` + - `user_location: optional object { type, city, country, 2 more }` - The y-coordinate. + The user's location. - - `type: "drag"` + - `type: "approximate"` - Specifies the event type. For a drag action, this property is always set to `drag`. + The type of location approximation. Always `approximate`. - - `"drag"` + - `"approximate"` - - `keys: optional array of string` + - `city: optional string` - The keys being held while dragging the mouse. + Free text input for the city of the user, e.g. `San Francisco`. - - `Keypress object { keys, type }` + - `country: optional string` - A collection of keypresses the model would like to perform. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `keys: array of string` + - `region: optional string` - The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + Free text input for the region of the user, e.g. `California`. - - `type: "keypress"` + - `timezone: optional string` - Specifies the event type. For a keypress action, this property is always set to `keypress`. + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `"keypress"` + - `ApplyPatch object { type }` - - `Move object { type, x, y, keys }` + Allows the assistant to create, delete, or update files using unified diffs. - A mouse move action. + - `type: "apply_patch"` - - `type: "move"` + The type of the tool. Always `apply_patch`. - Specifies the event type. For a move action, this property is always set to `move`. + - `"apply_patch"` - - `"move"` + - `type: "tool_search_output"` - - `x: number` + The item type. Always `tool_search_output`. - The x-coordinate to move to. + - `"tool_search_output"` - - `y: number` + - `id: optional string` - The y-coordinate to move to. + The unique ID of this tool search output. - - `keys: optional array of string` + - `call_id: optional string` - The keys being held while moving the mouse. + The unique ID of the tool search call generated by the model. - - `Screenshot object { type }` + - `execution: optional "server" or "client"` - A screenshot action. + Whether tool search was executed by the server or by the client. - - `type: "screenshot"` + - `"server"` - Specifies the event type. For a screenshot action, this property is always set to `screenshot`. + - `"client"` - - `"screenshot"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + The status of the tool search output. - A scroll action. + - `"in_progress"` - - `scroll_x: number` + - `"completed"` - The horizontal scroll distance. + - `"incomplete"` - - `scroll_y: number` + - `AdditionalTools object { role, tools, type, id }` - The vertical scroll distance. + - `role: "developer"` - - `type: "scroll"` + The role that provided the additional tools. Only `developer` is supported. - Specifies the event type. For a scroll action, this property is always set to `scroll`. + - `"developer"` - - `"scroll"` + - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` - - `x: number` + A list of additional tools made available at this item. - The x-coordinate where the scroll occurred. + - `Function object { name, parameters, strict, 3 more }` - - `y: number` + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - The y-coordinate where the scroll occurred. + - `name: string` - - `keys: optional array of string` + The name of the function to call. - The keys being held while scrolling. + - `parameters: map[unknown]` - - `Type object { text, type }` + A JSON schema object describing the parameters of the function. - An action to type in text. + - `strict: boolean` - - `text: string` + Whether to enforce strict parameter validation. Default `true`. - The text to type. + - `type: "function"` - - `type: "type"` + The type of the function tool. Always `function`. - Specifies the event type. For a type action, this property is always set to `type`. + - `"function"` - - `"type"` + - `defer_loading: optional boolean` - - `Wait object { type }` + Whether this function is deferred and loaded via tool search. - A wait action. + - `description: optional string` - - `type: "wait"` + A description of the function. Used by the model to determine whether or not to call the function. - Specifies the event type. For a wait action, this property is always set to `wait`. + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - `"wait"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `actions: optional ComputerActionList` + - `type: "file_search"` - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + The type of the file search tool. Always `file_search`. - - `Click object { button, type, x, 2 more }` + - `"file_search"` - A click action. + - `vector_store_ids: array of string` - - `DoubleClick object { keys, type, x, y }` + The IDs of the vector stores to search. - A double click action. + - `filters: optional ComparisonFilter or CompoundFilter` - - `Drag object { path, type, keys }` + A filter to apply. - A drag action. + - `ComparisonFilter object { key, type, value }` - - `Keypress object { keys, type }` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - A collection of keypresses the model would like to perform. + - `CompoundFilter object { filters, type }` - - `Move object { type, x, y, keys }` + Combine multiple filters using `and` or `or`. - A mouse move action. + - `max_num_results: optional number` - - `Screenshot object { type }` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - A screenshot action. + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - `Scroll object { scroll_x, scroll_y, type, 3 more }` + Ranking options for search. - A scroll action. + - `hybrid_search: optional object { embedding_weight, text_weight }` - - `Type object { text, type }` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - An action to type in text. + - `embedding_weight: number` - - `Wait object { type }` + The weight of the embedding in the reciprocal ranking fusion. - A wait action. + - `text_weight: number` - - `ComputerCallOutput object { call_id, output, type, 3 more }` + The weight of the text in the reciprocal ranking fusion. - The output of a computer tool call. + - `ranker: optional "auto" or "default-2024-11-15"` - - `call_id: string` + The ranker to use for the file search. - The ID of the computer tool call that produced the output. + - `"auto"` - - `output: ResponseComputerToolCallOutputScreenshot` + - `"default-2024-11-15"` - A computer screenshot image used with the computer use tool. + - `score_threshold: optional number` - - `type: "computer_screenshot"` + 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. - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. + - `Computer object { type }` - - `"computer_screenshot"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `file_id: optional string` + - `type: "computer"` - The identifier of an uploaded file that contains the screenshot. + The type of the computer tool. Always `computer`. - - `image_url: optional string` + - `"computer"` - The URL of the screenshot image. + - `ComputerUsePreview object { display_height, display_width, environment, type }` - - `type: "computer_call_output"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - The type of the computer tool call output. Always `computer_call_output`. + - `display_height: number` - - `"computer_call_output"` + The height of the computer display. - - `id: optional string` + - `display_width: number` - The ID of the computer tool call output. + The width of the computer display. - - `acknowledged_safety_checks: optional array of object { id, code, message }` + - `environment: "windows" or "mac" or "linux" or 2 more` - The safety checks reported by the API that have been acknowledged by the developer. + The type of computer environment to control. - - `id: string` + - `"windows"` - The ID of the pending safety check. + - `"mac"` - - `code: optional string` + - `"linux"` - The type of the pending safety check. + - `"ubuntu"` - - `message: optional string` + - `"browser"` - Details about the pending safety check. + - `type: "computer_use_preview"` - - `status: optional "in_progress" or "completed" or "incomplete"` + The type of the computer use tool. Always `computer_use_preview`. - The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API. + - `"computer_use_preview"` - - `"in_progress"` + - `WebSearch object { type, filters, search_context_size, user_location }` - - `"completed"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `"incomplete"` + - `type: "web_search" or "web_search_2025_08_26"` - - `WebSearchCall object { id, action, status, type }` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + - `"web_search"` - - `id: string` + - `"web_search_2025_08_26"` - The unique ID of the web search tool call. + - `filters: optional object { allowed_domains }` - - `action: object { query, type, queries, sources } or object { type, url } or object { pattern, type, url }` + Filters for the search. - 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). + - `allowed_domains: optional array of string` - - `Search object { query, type, queries, sources }` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - Action type "search" - Performs a web search query. + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `query: string` + - `search_context_size: optional "low" or "medium" or "high"` - [DEPRECATED] The search query. + 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. - - `type: "search"` + - `"low"` - The action type. + - `"medium"` - - `"search"` + - `"high"` - - `queries: optional array of string` + - `user_location: optional object { city, country, region, 2 more }` - The search queries. + The approximate location of the user. - - `sources: optional array of object { type, url }` + - `city: optional string` - The sources used in the search. + Free text input for the city of the user, e.g. `San Francisco`. - - `type: "url"` + - `country: optional string` - The type of source. Always `url`. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `"url"` + - `region: optional string` - - `url: string` + Free text input for the region of the user, e.g. `California`. - The URL of the source. + - `timezone: optional string` - - `OpenPage object { type, url }` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - Action type "open_page" - Opens a specific URL from search results. + - `type: optional "approximate"` - - `type: "open_page"` + The type of location approximation. Always `approximate`. - The action type. + - `"approximate"` - - `"open_page"` + - `Mcp object { server_label, type, allowed_tools, 7 more }` - - `url: optional string` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - The URL opened by the model. + - `server_label: string` - - `FindInPage object { pattern, type, url }` + A label for this MCP server, used to identify it in tool calls. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `type: "mcp"` - - `pattern: string` + The type of the MCP tool. Always `mcp`. - The pattern or text to search for within the page. + - `"mcp"` - - `type: "find_in_page"` + - `allowed_tools: optional array of string or object { read_only, tool_names }` - The action type. + List of allowed tool names or a filter object. - - `"find_in_page"` + - `McpAllowedTools = array of string` - - `url: string` + A string array of allowed tool names - The URL of the page searched for the pattern. + - `McpToolFilter object { read_only, tool_names }` - - `status: "in_progress" or "searching" or "completed" or "failed"` + A filter object to specify which tools are allowed. - The status of the web search tool call. + - `read_only: optional boolean` - - `"in_progress"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `"searching"` + - `tool_names: optional array of string` - - `"completed"` + List of allowed tool names. - - `"failed"` + - `authorization: optional string` - - `type: "web_search_call"` + 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. - The type of the web search tool call. Always `web_search_call`. + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - `"web_search_call"` + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](/docs/guides/tools-remote-mcp#connectors). - - `FunctionCall object { arguments, call_id, name, 4 more }` + Currently supported `connector_id` values are: - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + - 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` - - `arguments: string` + - `"connector_dropbox"` - A JSON string of the arguments to pass to the function. + - `"connector_gmail"` - - `call_id: string` + - `"connector_googlecalendar"` - The unique ID of the function tool call generated by the model. + - `"connector_googledrive"` - - `name: string` + - `"connector_microsoftteams"` - The name of the function to run. + - `"connector_outlookcalendar"` - - `type: "function_call"` + - `"connector_outlookemail"` - The type of the function tool call. Always `function_call`. + - `"connector_sharepoint"` - - `"function_call"` + - `defer_loading: optional boolean` - - `id: optional string` + Whether this MCP tool is deferred and discovered via tool search. - The unique ID of the function tool call. + - `headers: optional map[string]` - - `namespace: optional string` + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - The namespace of the function to run. + - `require_approval: optional object { always, never } or "always" or "never"` - - `status: optional "in_progress" or "completed" or "incomplete"` + Specify which of the MCP server's tools require approval. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `McpToolApprovalFilter object { always, never }` - - `"in_progress"` + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `"completed"` + - `always: optional object { read_only, tool_names }` - - `"incomplete"` + A filter object to specify which tools are allowed. - - `FunctionCallOutput object { call_id, output, type, 2 more }` + - `read_only: optional boolean` - The output of a function tool call. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `call_id: string` + - `tool_names: optional array of string` - The unique ID of the function tool call generated by the model. + List of allowed tool names. - - `output: string or array of ResponseInputTextContent or ResponseInputImageContent or ResponseInputFileContent` + - `never: optional object { read_only, tool_names }` - Text, image, or file output of the function tool call. + A filter object to specify which tools are allowed. - - `string` + - `read_only: optional boolean` - A JSON string of the output of the function tool call. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `array of ResponseInputTextContent or ResponseInputImageContent or ResponseInputFileContent` + - `tool_names: optional array of string` - An array of content outputs (text, image, file) for the function tool call. + List of allowed tool names. - - `ResponseInputTextContent object { text, type }` + - `McpToolApprovalSetting = "always" or "never"` - A text input to the model. + 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. - - `text: string` + - `"always"` - The text input to the model. + - `"never"` - - `type: "input_text"` + - `server_description: optional string` - The type of the input item. Always `input_text`. + Optional description of the MCP server, used to provide more context. - - `"input_text"` + - `server_url: optional string` - - `ResponseInputImageContent object { type, detail, file_id, image_url }` + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. - An image input to the model. Learn about [image inputs](/docs/guides/vision) + - `CodeInterpreter object { container, type }` - - `type: "input_image"` + A tool that runs Python code to help generate a response to a prompt. - The type of the input item. Always `input_image`. + - `container: string or object { type, file_ids, memory_limit, network_policy }` - - `"input_image"` + 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. - - `detail: optional "low" or "high" or "auto" or "original"` + - `string` - The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + The container ID. - - `"low"` + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `"high"` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - - `"auto"` + - `type: "auto"` - - `"original"` + Always `auto`. - - `file_id: optional string` + - `"auto"` - The ID of the file to be sent to the model. + - `file_ids: optional array of string` - - `image_url: optional string` + An optional list of uploaded files to make available to your code. - The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `ResponseInputFileContent object { type, detail, file_data, 3 more }` + The memory limit for the code interpreter container. - A file input to the model. + - `"1g"` - - `type: "input_file"` + - `"4g"` - The type of the input item. Always `input_file`. + - `"16g"` - - `"input_file"` + - `"64g"` - - `detail: optional "low" or "high"` + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` - The detail level of the file to be sent to the model. Use `low` for the default rendering behavior, or `high` to render the file at higher quality. Defaults to `low`. + Network access policy for the container. - - `"low"` + - `ContainerNetworkPolicyDisabled object { type }` - - `"high"` + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `file_data: optional string` + - `type: "code_interpreter"` - The base64-encoded data of the file to be sent to the model. + The type of the code interpreter tool. Always `code_interpreter`. - - `file_id: optional string` + - `"code_interpreter"` - The ID of the file to be sent to the model. + - `ImageGeneration object { type, action, background, 9 more }` - - `file_url: optional string` + A tool that generates images using the GPT image models. - The URL of the file to be sent to the model. + - `type: "image_generation"` - - `filename: optional string` + The type of the image generation tool. Always `image_generation`. - The name of the file to be sent to the model. + - `"image_generation"` - - `type: "function_call_output"` + - `action: optional "generate" or "edit" or "auto"` - The type of the function tool call output. Always `function_call_output`. + Whether to generate a new image or edit an existing image. Default: `auto`. - - `"function_call_output"` + - `"generate"` - - `id: optional string` + - `"edit"` - The unique ID of the function tool call output. Populated when this item is returned via API. + - `"auto"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `background: optional "transparent" or "opaque" or "auto"` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - - `"in_progress"` + - `"transparent"` - - `"completed"` + - `"opaque"` - - `"incomplete"` + - `"auto"` - - `ToolSearchCall object { arguments, type, id, 3 more }` + - `input_fidelity: optional "high" or "low"` - - `arguments: unknown` + 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`. - The arguments supplied to the tool search call. + - `"high"` - - `type: "tool_search_call"` + - `"low"` - The item type. Always `tool_search_call`. + - `input_image_mask: optional object { file_id, image_url }` - - `"tool_search_call"` + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `id: optional string` + - `file_id: optional string` - The unique ID of this tool search call. + File ID for the mask image. - - `call_id: optional string` + - `image_url: optional string` - The unique ID of the tool search call generated by the model. + Base64-encoded mask image. - - `execution: optional "server" or "client"` + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - Whether tool search was executed by the server or by the client. + The image generation model to use. Default: `gpt-image-1`. - - `"server"` + - `string` - - `"client"` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `status: optional "in_progress" or "completed" or "incomplete"` + The image generation model to use. Default: `gpt-image-1`. - The status of the tool search call. + - `"gpt-image-1"` - - `"in_progress"` + - `"gpt-image-1-mini"` - - `"completed"` + - `"gpt-image-1.5"` - - `"incomplete"` + - `moderation: optional "auto" or "low"` - - `ToolSearchOutput object { tools, type, id, 3 more }` + Moderation level for the generated image. Default: `auto`. - - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` + - `"auto"` - The loaded tool definitions returned by the tool search output. + - `"low"` - - `Function object { name, parameters, strict, 3 more }` + - `output_compression: optional number` - Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + Compression level for the output image. Default: 100. - - `name: string` + - `output_format: optional "png" or "webp" or "jpeg"` - The name of the function to call. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `parameters: map[unknown]` + - `"png"` - A JSON schema object describing the parameters of the function. + - `"webp"` - - `strict: boolean` + - `"jpeg"` - Whether to enforce strict parameter validation. Default `true`. + - `partial_images: optional number` - - `type: "function"` + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - The type of the function tool. Always `function`. + - `quality: optional "low" or "medium" or "high" or "auto"` - - `"function"` + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `defer_loading: optional boolean` + - `"low"` - Whether this function is deferred and loaded via tool search. + - `"medium"` - - `description: optional string` + - `"high"` - A description of the function. Used by the model to determine whether or not to call the function. + - `"auto"` - - `FileSearch object { type, vector_store_ids, filters, 2 more }` + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + 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`. - - `type: "file_search"` + - `string` - The type of the file search tool. Always `file_search`. + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `"file_search"` + 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`. - - `vector_store_ids: array of string` + - `"1024x1024"` - The IDs of the vector stores to search. + - `"1024x1536"` - - `filters: optional ComparisonFilter or CompoundFilter` + - `"1536x1024"` - A filter to apply. + - `"auto"` - - `ComparisonFilter object { key, type, value }` + - `LocalShell object { type }` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + A tool that allows the model to execute shell commands in a local environment. - - `key: string` + - `type: "local_shell"` - The key to compare against the value. + The type of the local shell tool. Always `local_shell`. - - `type: "eq" or "ne" or "gt" or 5 more` + - `"local_shell"` - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `Shell object { type, environment }` - - `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 + A tool that allows the model to execute shell commands. - - `"eq"` + - `type: "shell"` - - `"ne"` + The type of the shell tool. Always `shell`. - - `"gt"` + - `"shell"` - - `"gte"` + - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` - - `"lt"` + - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `"lte"` + - `LocalEnvironment object { type, skills }` - - `"in"` + - `ContainerReference object { container_id, type }` - - `"nin"` + - `Custom object { name, type, defer_loading, 2 more }` - - `value: string or number or boolean or array of string or number` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - The value to compare against the attribute key; supports string, number, or boolean types. + - `name: string` - - `string` + The name of the custom tool, used to identify it in tool calls. - - `number` + - `type: "custom"` - - `boolean` + The type of the custom tool. Always `custom`. - - `array of string or number` + - `"custom"` - - `string` + - `defer_loading: optional boolean` - - `number` + Whether this tool should be deferred and discovered via tool search. - - `CompoundFilter object { filters, type }` + - `description: optional string` - Combine multiple filters using `and` or `or`. + Optional description of the custom tool, used to provide more context. - - `filters: array of ComparisonFilter or unknown` + - `format: optional CustomToolInputFormat` - Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + The input format for the custom tool. Default is unconstrained text. - - `ComparisonFilter object { key, type, value }` + - `Namespace object { description, name, tools, type }` - A filter used to compare a specified attribute key to a given value using a defined comparison operation. + Groups function/custom tools under a shared namespace. - - `unknown` + - `description: string` - - `type: "and" or "or"` + A description of the namespace shown to the model. - Type of operation: `and` or `or`. + - `name: string` - - `"and"` + The namespace name used in tool calls (for example, `crm`). - - `"or"` + - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` - - `max_num_results: optional number` + The function/custom tools available inside this namespace. - The maximum number of results to return. This number should be between 1 and 50 inclusive. + - `Function object { name, type, defer_loading, 3 more }` - - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` + - `name: string` - Ranking options for search. + - `type: "function"` - - `hybrid_search: optional object { embedding_weight, text_weight }` + - `"function"` - Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + - `defer_loading: optional boolean` - - `embedding_weight: number` + Whether this function should be deferred and discovered via tool search. - The weight of the embedding in the reciprocal ranking fusion. + - `description: optional string` - - `text_weight: number` + - `parameters: optional unknown` - The weight of the text in the reciprocal ranking fusion. + - `strict: optional boolean` - - `ranker: optional "auto" or "default-2024-11-15"` + - `Custom object { name, type, defer_loading, 2 more }` - The ranker to use for the file search. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `"auto"` + - `name: string` - - `"default-2024-11-15"` + The name of the custom tool, used to identify it in tool calls. - - `score_threshold: optional number` + - `type: "custom"` - 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. + The type of the custom tool. Always `custom`. - - `Computer object { type }` + - `"custom"` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + - `defer_loading: optional boolean` - - `type: "computer"` + Whether this tool should be deferred and discovered via tool search. - The type of the computer tool. Always `computer`. + - `description: optional string` - - `"computer"` + Optional description of the custom tool, used to provide more context. - - `ComputerUsePreview object { display_height, display_width, environment, type }` + - `format: optional CustomToolInputFormat` - A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + The input format for the custom tool. Default is unconstrained text. - - `display_height: number` + - `type: "namespace"` - The height of the computer display. + The type of the tool. Always `namespace`. - - `display_width: number` + - `"namespace"` - The width of the computer display. + - `ToolSearch object { type, description, execution, parameters }` - - `environment: "windows" or "mac" or "linux" or 2 more` + Hosted or BYOT tool search configuration for deferred tools. - The type of computer environment to control. + - `type: "tool_search"` - - `"windows"` + The type of the tool. Always `tool_search`. - - `"mac"` + - `"tool_search"` - - `"linux"` + - `description: optional string` - - `"ubuntu"` + Description shown to the model for a client-executed tool search tool. - - `"browser"` + - `execution: optional "server" or "client"` - - `type: "computer_use_preview"` + Whether tool search is executed by the server or by the client. - The type of the computer use tool. Always `computer_use_preview`. + - `"server"` - - `"computer_use_preview"` + - `"client"` - - `WebSearch object { type, filters, search_context_size, user_location }` + - `parameters: optional unknown` - Search the Internet for sources related to the prompt. Learn more about the - [web search tool](/docs/guides/tools-web-search). + Parameter schema for a client-executed tool search tool. - - `type: "web_search" or "web_search_2025_08_26"` + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `"web_search"` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - - `"web_search_2025_08_26"` + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `filters: optional object { allowed_domains }` + - `"web_search_preview"` - Filters for the search. + - `"web_search_preview_2025_03_11"` - - `allowed_domains: optional array of string` + - `search_content_types: optional array of "text" or "image"` - Allowed domains for the search. If not provided, all domains are allowed. - Subdomains of the provided domains are allowed as well. + - `"text"` - Example: `["pubmed.ncbi.nlm.nih.gov"]` + - `"image"` - `search_context_size: optional "low" or "medium" or "high"` @@ -5727,9 +7947,15 @@ as input for the model's response. - `"high"` - - `user_location: optional object { city, country, region, 2 more }` + - `user_location: optional object { type, city, country, 2 more }` - The approximate location of the user. + The user's location. + + - `type: "approximate"` + + The type of location approximation. Always `approximate`. + + - `"approximate"` - `city: optional string` @@ -5747,1139 +7973,1144 @@ as input for the model's response. The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `type: optional "approximate"` + - `ApplyPatch object { type }` - The type of location approximation. Always `approximate`. + Allows the assistant to create, delete, or update files using unified diffs. - - `"approximate"` + - `type: "apply_patch"` - - `Mcp object { server_label, type, allowed_tools, 7 more }` + The type of the tool. Always `apply_patch`. - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). + - `"apply_patch"` - - `server_label: string` + - `type: "additional_tools"` - A label for this MCP server, used to identify it in tool calls. + The item type. Always `additional_tools`. - - `type: "mcp"` + - `"additional_tools"` - The type of the MCP tool. Always `mcp`. + - `id: optional string` - - `"mcp"` + The unique ID of this additional tools item. - - `allowed_tools: optional array of string or object { read_only, tool_names }` + - `Reasoning object { id, summary, type, 3 more }` - List of allowed tool names or a filter object. + 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](/docs/guides/conversation-state). - - `McpAllowedTools = array of string` + - `id: string` - A string array of allowed tool names + The unique identifier of the reasoning content. - - `McpToolFilter object { read_only, tool_names }` + - `summary: array of SummaryTextContent` - A filter object to specify which tools are allowed. + Reasoning summary content. - - `read_only: optional boolean` + - `text: string` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + A summary of the reasoning output from the model so far. - - `tool_names: optional array of string` + - `type: "summary_text"` - List of allowed tool names. + The type of the object. Always `summary_text`. - - `authorization: optional string` + - `"summary_text"` - 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. + - `type: "reasoning"` - - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` + The type of the object. Always `reasoning`. - Identifier for service connectors, like those available in ChatGPT. One of - `server_url` or `connector_id` must be provided. Learn more about service - connectors [here](/docs/guides/tools-remote-mcp#connectors). + - `"reasoning"` - Currently supported `connector_id` values are: + - `content: optional array of object { text, type }` - - 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` + Reasoning text content. - - `"connector_dropbox"` + - `text: string` - - `"connector_gmail"` + The reasoning text from the model. - - `"connector_googlecalendar"` + - `type: "reasoning_text"` - - `"connector_googledrive"` + The type of the reasoning text. Always `reasoning_text`. - - `"connector_microsoftteams"` + - `"reasoning_text"` - - `"connector_outlookcalendar"` + - `encrypted_content: optional string` - - `"connector_outlookemail"` + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. - - `"connector_sharepoint"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `defer_loading: optional boolean` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - Whether this MCP tool is deferred and discovered via tool search. + - `"in_progress"` - - `headers: optional map[string]` + - `"completed"` - Optional HTTP headers to send to the MCP server. Use for authentication - or other purposes. + - `"incomplete"` - - `require_approval: optional object { always, never } or "always" or "never"` + - `Compaction object { encrypted_content, type, id }` - Specify which of the MCP server's tools require approval. + A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - - `McpToolApprovalFilter object { always, never }` + - `encrypted_content: string` - Specify which of the MCP server's tools require approval. Can be - `always`, `never`, or a filter object associated with tools - that require approval. + The encrypted content of the compaction summary. - - `always: optional object { read_only, tool_names }` + - `type: "compaction"` - A filter object to specify which tools are allowed. + The type of the item. Always `compaction`. - - `read_only: optional boolean` + - `"compaction"` - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `id: optional string` - - `tool_names: optional array of string` + The ID of the compaction item. - List of allowed tool names. + - `ImageGenerationCall object { id, result, status, type }` - - `never: optional object { read_only, tool_names }` + An image generation request made by the model. - A filter object to specify which tools are allowed. + - `id: string` - - `read_only: optional boolean` + The unique ID of the image generation call. - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. + - `result: string` - - `tool_names: optional array of string` + The generated image encoded in base64. - List of allowed tool names. + - `status: "in_progress" or "completed" or "generating" or "failed"` - - `McpToolApprovalSetting = "always" or "never"` + The status of the image generation call. - 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. + - `"in_progress"` - - `"always"` + - `"completed"` - - `"never"` + - `"generating"` - - `server_description: optional string` + - `"failed"` - Optional description of the MCP server, used to provide more context. + - `type: "image_generation_call"` - - `server_url: optional string` + The type of the image generation call. Always `image_generation_call`. - The URL for the MCP server. One of `server_url` or `connector_id` must be - provided. + - `"image_generation_call"` - - `CodeInterpreter object { container, type }` + - `CodeInterpreterCall object { id, code, container_id, 3 more }` - A tool that runs Python code to help generate a response to a prompt. + A tool call to run code. - - `container: string or object { type, file_ids, memory_limit, network_policy }` + - `id: string` - 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 unique ID of the code interpreter tool call. - - `string` + - `code: string` - The container ID. + The code to run, or null if not available. - - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` + - `container_id: string` - Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + The ID of the container used to run the code. - - `type: "auto"` + - `outputs: array of object { logs, type } or object { type, url }` - Always `auto`. + The outputs generated by the code interpreter, such as logs or images. + Can be null if no outputs are available. - - `"auto"` + - `Logs object { logs, type }` - - `file_ids: optional array of string` + The logs output from the code interpreter. - An optional list of uploaded files to make available to your code. + - `logs: string` - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + The logs output from the code interpreter. - The memory limit for the code interpreter container. + - `type: "logs"` - - `"1g"` + The type of the output. Always `logs`. - - `"4g"` + - `"logs"` - - `"16g"` + - `Image object { type, url }` - - `"64g"` + The image output from the code interpreter. - - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` + - `type: "image"` - Network access policy for the container. + The type of the output. Always `image`. - - `ContainerNetworkPolicyDisabled object { type }` + - `"image"` - - `type: "disabled"` + - `url: string` - Disable outbound network access. Always `disabled`. + The URL of the image output from the code interpreter. - - `"disabled"` + - `status: "in_progress" or "completed" or "incomplete" or 2 more` - - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - - `allowed_domains: array of string` + - `"in_progress"` - A list of allowed domains when type is `allowlist`. + - `"completed"` - - `type: "allowlist"` + - `"incomplete"` - Allow outbound network access only to specified domains. Always `allowlist`. + - `"interpreting"` - - `"allowlist"` + - `"failed"` - - `domain_secrets: optional array of ContainerNetworkPolicyDomainSecret` + - `type: "code_interpreter_call"` - Optional domain-scoped secrets for allowlisted domains. + The type of the code interpreter tool call. Always `code_interpreter_call`. - - `domain: string` + - `"code_interpreter_call"` + + - `LocalShellCall object { id, action, call_id, 2 more }` + + A tool call to run a command on the local shell. + + - `id: string` + + The unique ID of the local shell call. + + - `action: object { command, env, type, 3 more }` + + Execute a shell command on the server. + + - `command: array of string` - The domain associated with the secret. + The command to run. - - `name: string` + - `env: map[string]` - The name of the secret to inject for the domain. + Environment variables to set for the command. - - `value: string` + - `type: "exec"` - The secret value to inject for the domain. + The type of the local shell action. Always `exec`. - - `type: "code_interpreter"` + - `"exec"` - The type of the code interpreter tool. Always `code_interpreter`. + - `timeout_ms: optional number` - - `"code_interpreter"` + Optional timeout in milliseconds for the command. - - `ImageGeneration object { type, action, background, 9 more }` + - `user: optional string` - A tool that generates images using the GPT image models. + Optional user to run the command as. - - `type: "image_generation"` + - `working_directory: optional string` - The type of the image generation tool. Always `image_generation`. + Optional working directory to run the command in. - - `"image_generation"` + - `call_id: string` - - `action: optional "generate" or "edit" or "auto"` + The unique ID of the local shell tool call generated by the model. - Whether to generate a new image or edit an existing image. Default: `auto`. + - `status: "in_progress" or "completed" or "incomplete"` - - `"generate"` + The status of the local shell call. - - `"edit"` + - `"in_progress"` - - `"auto"` + - `"completed"` - - `background: optional "transparent" or "opaque" or "auto"` + - `"incomplete"` - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. + - `type: "local_shell_call"` - - `"transparent"` + The type of the local shell call. Always `local_shell_call`. - - `"opaque"` + - `"local_shell_call"` - - `"auto"` + - `LocalShellCallOutput object { id, output, type, status }` - - `input_fidelity: optional "high" or "low"` + The output of a local shell tool call. - 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`. + - `id: string` - - `"high"` + The unique ID of the local shell tool call generated by the model. - - `"low"` + - `output: string` - - `input_image_mask: optional object { file_id, image_url }` + A JSON string of the output of the local shell tool call. - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). + - `type: "local_shell_call_output"` - - `file_id: optional string` + The type of the local shell tool call output. Always `local_shell_call_output`. - File ID for the mask image. + - `"local_shell_call_output"` - - `image_url: optional string` + - `status: optional "in_progress" or "completed" or "incomplete"` - Base64-encoded mask image. + The status of the item. One of `in_progress`, `completed`, or `incomplete`. - - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `"in_progress"` - The image generation model to use. Default: `gpt-image-1`. + - `"completed"` - - `string` + - `"incomplete"` - - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` + - `ShellCall object { action, call_id, type, 3 more }` - The image generation model to use. Default: `gpt-image-1`. + A tool representing a request to execute one or more shell commands. - - `"gpt-image-1"` + - `action: object { commands, max_output_length, timeout_ms }` - - `"gpt-image-1-mini"` + The shell commands and limits that describe how to run the tool call. - - `"gpt-image-1.5"` + - `commands: array of string` - - `moderation: optional "auto" or "low"` + Ordered shell commands for the execution environment to run. - Moderation level for the generated image. Default: `auto`. + - `max_output_length: optional number` - - `"auto"` + Maximum number of UTF-8 characters to capture from combined stdout and stderr output. - - `"low"` + - `timeout_ms: optional number` - - `output_compression: optional number` + Maximum wall-clock time in milliseconds to allow the shell commands to run. - Compression level for the output image. Default: 100. + - `call_id: string` - - `output_format: optional "png" or "webp" or "jpeg"` + The unique ID of the shell tool call generated by the model. - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. + - `type: "shell_call"` - - `"png"` + The type of the item. Always `shell_call`. - - `"webp"` + - `"shell_call"` - - `"jpeg"` + - `id: optional string` - - `partial_images: optional number` + The unique ID of the shell tool call. Populated when this item is returned via API. - Number of partial images to generate in streaming mode, from 0 (default value) to 3. + - `environment: optional LocalEnvironment or ContainerReference` - - `quality: optional "low" or "medium" or "high" or "auto"` + The environment to execute the shell commands in. - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. + - `LocalEnvironment object { type, skills }` - - `"low"` + - `ContainerReference object { container_id, type }` - - `"medium"` + - `status: optional "in_progress" or "completed" or "incomplete"` - - `"high"` + The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - - `"auto"` + - `"in_progress"` - - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` + - `"completed"` - 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`. + - `"incomplete"` - - `string` + - `ShellCallOutput object { call_id, output, type, 3 more }` - - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` + The streamed output items emitted by a shell tool call. - 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`. + - `call_id: string` - - `"1024x1024"` + The unique ID of the shell tool call generated by the model. - - `"1024x1536"` + - `output: array of ResponseFunctionShellCallOutputContent` - - `"1536x1024"` + Captured chunks of stdout and stderr output, along with their associated outcomes. - - `"auto"` + - `outcome: object { type } or object { exit_code, type }` - - `LocalShell object { type }` + The exit or timeout outcome associated with this shell call. - A tool that allows the model to execute shell commands in a local environment. + - `Timeout object { type }` - - `type: "local_shell"` + Indicates that the shell call exceeded its configured time limit. - The type of the local shell tool. Always `local_shell`. + - `type: "timeout"` - - `"local_shell"` + The outcome type. Always `timeout`. - - `Shell object { type, environment }` + - `"timeout"` - A tool that allows the model to execute shell commands. + - `Exit object { exit_code, type }` - - `type: "shell"` + Indicates that the shell commands finished and returned an exit code. - The type of the shell tool. Always `shell`. + - `exit_code: number` - - `"shell"` + The exit code returned by the shell process. - - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` + - `type: "exit"` - - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` + The outcome type. Always `exit`. - - `type: "container_auto"` + - `"exit"` - Automatically creates a container for this request + - `stderr: string` - - `"container_auto"` + Captured stderr output for the shell call. - - `file_ids: optional array of string` + - `stdout: string` - An optional list of uploaded files to make available to your code. + Captured stdout output for the shell call. - - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` + - `type: "shell_call_output"` - The memory limit for the container. + The type of the item. Always `shell_call_output`. - - `"1g"` + - `"shell_call_output"` - - `"4g"` + - `id: optional string` - - `"16g"` + The unique ID of the shell tool call output. Populated when this item is returned via API. - - `"64g"` + - `max_output_length: optional number` - - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` + The maximum number of UTF-8 characters captured for this shell call's combined output. - Network access policy for the container. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `ContainerNetworkPolicyDisabled object { type }` + The status of the shell call output. - - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` + - `"in_progress"` - - `skills: optional array of SkillReference or InlineSkill` + - `"completed"` - An optional list of skills referenced by id or inline data. + - `"incomplete"` - - `SkillReference object { skill_id, type, version }` + - `ApplyPatchCall object { call_id, operation, status, 2 more }` - - `skill_id: string` + A tool call representing a request to create, delete, or update files using diff patches. - The ID of the referenced skill. + - `call_id: string` - - `type: "skill_reference"` + The unique ID of the apply patch tool call generated by the model. - References a skill created with the /v1/skills endpoint. + - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` - - `"skill_reference"` + The specific create, delete, or update instruction for the apply_patch tool call. - - `version: optional string` + - `CreateFile object { diff, path, type }` - Optional skill version. Use a positive integer or 'latest'. Omit for default. + Instruction for creating a new file via the apply_patch tool. - - `InlineSkill object { description, name, source, type }` + - `diff: string` - - `description: string` + Unified diff content to apply when creating the file. - The description of the skill. + - `path: string` - - `name: string` + Path of the file to create relative to the workspace root. - The name of the skill. + - `type: "create_file"` - - `source: InlineSkillSource` + The operation type. Always `create_file`. - Inline skill payload + - `"create_file"` - - `data: string` + - `DeleteFile object { path, type }` - Base64-encoded skill zip bundle. + Instruction for deleting an existing file via the apply_patch tool. - - `media_type: "application/zip"` + - `path: string` - The media type of the inline skill payload. Must be `application/zip`. + Path of the file to delete relative to the workspace root. - - `"application/zip"` + - `type: "delete_file"` - - `type: "base64"` + The operation type. Always `delete_file`. - The type of the inline skill source. Must be `base64`. + - `"delete_file"` - - `"base64"` + - `UpdateFile object { diff, path, type }` - - `type: "inline"` + Instruction for updating an existing file via the apply_patch tool. - Defines an inline skill for this request. + - `diff: string` - - `"inline"` + Unified diff content to apply to the existing file. - - `LocalEnvironment object { type, skills }` + - `path: string` - - `type: "local"` + Path of the file to update relative to the workspace root. - Use a local computer environment. + - `type: "update_file"` - - `"local"` + The operation type. Always `update_file`. - - `skills: optional array of LocalSkill` + - `"update_file"` - An optional list of skills. + - `status: "in_progress" or "completed"` - - `description: string` + The status of the apply patch tool call. One of `in_progress` or `completed`. - The description of the skill. + - `"in_progress"` - - `name: string` + - `"completed"` - The name of the skill. + - `type: "apply_patch_call"` - - `path: string` + The type of the item. Always `apply_patch_call`. - The path to the directory containing the skill. + - `"apply_patch_call"` - - `ContainerReference object { container_id, type }` + - `id: optional string` - - `container_id: string` + The unique ID of the apply patch tool call. Populated when this item is returned via API. - The ID of the referenced container. + - `ApplyPatchCallOutput object { call_id, status, type, 2 more }` - - `type: "container_reference"` + The streamed output emitted by an apply patch tool call. - References a container created with the /v1/containers endpoint + - `call_id: string` - - `"container_reference"` + The unique ID of the apply patch tool call generated by the model. - - `Custom object { name, type, defer_loading, 2 more }` + - `status: "completed" or "failed"` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + The status of the apply patch tool call output. One of `completed` or `failed`. - - `name: string` + - `"completed"` - The name of the custom tool, used to identify it in tool calls. + - `"failed"` - - `type: "custom"` + - `type: "apply_patch_call_output"` - The type of the custom tool. Always `custom`. + The type of the item. Always `apply_patch_call_output`. - - `"custom"` + - `"apply_patch_call_output"` - - `defer_loading: optional boolean` + - `id: optional string` - Whether this tool should be deferred and discovered via tool search. + The unique ID of the apply patch tool call output. Populated when this item is returned via API. - - `description: optional string` + - `output: optional string` - Optional description of the custom tool, used to provide more context. + Optional human-readable log text from the apply patch tool (e.g., patch results or errors). - - `format: optional CustomToolInputFormat` + - `McpListTools object { id, server_label, tools, 2 more }` - The input format for the custom tool. Default is unconstrained text. + A list of tools available on an MCP server. - - `Text object { type }` + - `id: string` - Unconstrained free-form text. + The unique ID of the list. - - `type: "text"` + - `server_label: string` - Unconstrained text format. Always `text`. + The label of the MCP server. - - `"text"` + - `tools: array of object { input_schema, name, annotations, description }` - - `Grammar object { definition, syntax, type }` + The tools available on the server. - A grammar defined by the user. + - `input_schema: unknown` - - `definition: string` + The JSON schema describing the tool's input. - The grammar definition. + - `name: string` - - `syntax: "lark" or "regex"` + The name of the tool. - The syntax of the grammar definition. One of `lark` or `regex`. + - `annotations: optional unknown` - - `"lark"` + Additional annotations about the tool. - - `"regex"` + - `description: optional string` - - `type: "grammar"` + The description of the tool. - Grammar format. Always `grammar`. + - `type: "mcp_list_tools"` - - `"grammar"` + The type of the item. Always `mcp_list_tools`. - - `Namespace object { description, name, tools, type }` + - `"mcp_list_tools"` - Groups function/custom tools under a shared namespace. + - `error: optional string` - - `description: string` + Error message if the server could not list tools. - A description of the namespace shown to the model. + - `McpApprovalRequest object { id, arguments, name, 2 more }` - - `name: string` + A request for human approval of a tool invocation. - The namespace name used in tool calls (for example, `crm`). + - `id: string` - - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` + The unique ID of the approval request. - The function/custom tools available inside this namespace. + - `arguments: string` - - `Function object { name, type, defer_loading, 3 more }` + A JSON string of arguments for the tool. - `name: string` - - `type: "function"` - - - `"function"` + The name of the tool to run. - - `defer_loading: optional boolean` + - `server_label: string` - Whether this function should be deferred and discovered via tool search. + The label of the MCP server making the request. - - `description: optional string` + - `type: "mcp_approval_request"` - - `parameters: optional unknown` + The type of the item. Always `mcp_approval_request`. - - `strict: optional boolean` + - `"mcp_approval_request"` - - `Custom object { name, type, defer_loading, 2 more }` + - `McpApprovalResponse object { approval_request_id, approve, type, 2 more }` - A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) + A response to an MCP approval request. - - `name: string` + - `approval_request_id: string` - The name of the custom tool, used to identify it in tool calls. + The ID of the approval request being answered. - - `type: "custom"` + - `approve: boolean` - The type of the custom tool. Always `custom`. + Whether the request was approved. - - `"custom"` + - `type: "mcp_approval_response"` - - `defer_loading: optional boolean` + The type of the item. Always `mcp_approval_response`. - Whether this tool should be deferred and discovered via tool search. + - `"mcp_approval_response"` - - `description: optional string` + - `id: optional string` - Optional description of the custom tool, used to provide more context. + The unique ID of the approval response - - `format: optional CustomToolInputFormat` + - `reason: optional string` - The input format for the custom tool. Default is unconstrained text. + Optional reason for the decision. - - `type: "namespace"` + - `McpCall object { id, arguments, name, 6 more }` - The type of the tool. Always `namespace`. + An invocation of a tool on an MCP server. - - `"namespace"` + - `id: string` - - `ToolSearch object { type, description, execution, parameters }` + The unique ID of the tool call. - Hosted or BYOT tool search configuration for deferred tools. + - `arguments: string` - - `type: "tool_search"` + A JSON string of the arguments passed to the tool. - The type of the tool. Always `tool_search`. + - `name: string` - - `"tool_search"` + The name of the tool that was run. - - `description: optional string` + - `server_label: string` - Description shown to the model for a client-executed tool search tool. + The label of the MCP server running the tool. - - `execution: optional "server" or "client"` + - `type: "mcp_call"` - Whether tool search is executed by the server or by the client. + The type of the item. Always `mcp_call`. - - `"server"` + - `"mcp_call"` - - `"client"` + - `approval_request_id: optional string` - - `parameters: optional unknown` + 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. - Parameter schema for a client-executed tool search tool. + - `error: optional string` - - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` + The error from the tool call, if any. - This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + - `output: optional string` - - `type: "web_search_preview" or "web_search_preview_2025_03_11"` + The output from the tool call. - The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` - - `"web_search_preview"` + The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - - `"web_search_preview_2025_03_11"` + - `"in_progress"` - - `search_content_types: optional array of "text" or "image"` + - `"completed"` - - `"text"` + - `"incomplete"` - - `"image"` + - `"calling"` - - `search_context_size: optional "low" or "medium" or "high"` + - `"failed"` - 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. + - `CustomToolCallOutput object { call_id, output, type, id }` - - `"low"` + The output of a custom tool call from your code, being sent back to the model. - - `"medium"` + - `call_id: string` - - `"high"` + The call ID, used to map this custom tool call output to a custom tool call. - - `user_location: optional object { type, city, country, 2 more }` + - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` - The user's location. + The output from the custom tool call generated by your code. + Can be a string or an list of output content. - - `type: "approximate"` + - `StringOutput = string` - The type of location approximation. Always `approximate`. + A string of the output of the custom tool call. - - `"approximate"` + - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` - - `city: optional string` + Text, image, or file output of the custom tool call. - Free text input for the city of the user, e.g. `San Francisco`. + - `ResponseInputText object { text, type }` - - `country: optional string` + A text input to the model. - The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. + - `ResponseInputImage object { detail, type, file_id, image_url }` - - `region: optional string` + An image input to the model. Learn about [image inputs](/docs/guides/vision). - Free text input for the region of the user, e.g. `California`. + - `ResponseInputFile object { type, detail, file_data, 3 more }` - - `timezone: optional string` + A file input to the model. - The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. + - `type: "custom_tool_call_output"` - - `ApplyPatch object { type }` + The type of the custom tool call output. Always `custom_tool_call_output`. - Allows the assistant to create, delete, or update files using unified diffs. + - `"custom_tool_call_output"` - - `type: "apply_patch"` + - `id: optional string` - The type of the tool. Always `apply_patch`. + The unique ID of the custom tool call output in the OpenAI platform. - - `"apply_patch"` + - `CustomToolCall object { call_id, input, name, 3 more }` - - `type: "tool_search_output"` + A call to a custom tool created by the model. - The item type. Always `tool_search_output`. + - `call_id: string` - - `"tool_search_output"` + An identifier used to map this custom tool call to a tool call output. - - `id: optional string` + - `input: string` - The unique ID of this tool search output. + The input for the custom tool call generated by the model. - - `call_id: optional string` + - `name: string` - The unique ID of the tool search call generated by the model. + The name of the custom tool being called. - - `execution: optional "server" or "client"` + - `type: "custom_tool_call"` - Whether tool search was executed by the server or by the client. + The type of the custom tool call. Always `custom_tool_call`. - - `"server"` + - `"custom_tool_call"` - - `"client"` + - `id: optional string` - - `status: optional "in_progress" or "completed" or "incomplete"` + The unique ID of the custom tool call in the OpenAI platform. - The status of the tool search output. + - `namespace: optional string` - - `"in_progress"` + The namespace of the custom tool being called. - - `"completed"` + - `CompactionTrigger object { type }` - - `"incomplete"` + Compacts the current context. Must be the final input item. - - `Reasoning object { id, summary, type, 3 more }` + - `type: "compaction_trigger"` - 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](/docs/guides/conversation-state). + The type of the item. Always `compaction_trigger`. - - `id: string` + - `"compaction_trigger"` - The unique identifier of the reasoning content. + - `ItemReference object { id, type }` - - `summary: array of SummaryTextContent` + An internal identifier for an item to reference. - Reasoning summary content. + - `id: string` - - `text: string` + The ID of the item to reference. - A summary of the reasoning output from the model so far. + - `type: optional "item_reference"` - - `type: "summary_text"` + The type of item to reference. Always `item_reference`. - The type of the object. Always `summary_text`. + - `"item_reference"` - - `"summary_text"` + - `metadata: Metadata` - - `type: "reasoning"` + 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. - The type of the object. Always `reasoning`. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. - - `"reasoning"` + - `model: ResponsesModel` - - `content: optional array of object { text, type }` + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](/docs/models) + to browse and compare available models. - Reasoning text content. + - `string` - - `text: string` + - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more` - The reasoning text from the model. + - `"gpt-5.4"` - - `type: "reasoning_text"` + - `"gpt-5.4-mini"` - The type of the reasoning text. Always `reasoning_text`. + - `"gpt-5.4-nano"` - - `"reasoning_text"` + - `"gpt-5.4-mini-2026-03-17"` - - `encrypted_content: optional string` + - `"gpt-5.4-nano-2026-03-17"` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + - `"gpt-5.3-chat-latest"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"gpt-5.2"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"gpt-5.2-2025-12-11"` - - `"in_progress"` + - `"gpt-5.2-chat-latest"` - - `"completed"` + - `"gpt-5.2-pro"` - - `"incomplete"` + - `"gpt-5.2-pro-2025-12-11"` - - `Compaction object { encrypted_content, type, id }` + - `"gpt-5.1"` - A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). + - `"gpt-5.1-2025-11-13"` - - `encrypted_content: string` + - `"gpt-5.1-codex"` - The encrypted content of the compaction summary. + - `"gpt-5.1-mini"` - - `type: "compaction"` + - `"gpt-5.1-chat-latest"` - The type of the item. Always `compaction`. + - `"gpt-5"` - - `"compaction"` + - `"gpt-5-mini"` - - `id: optional string` + - `"gpt-5-nano"` - The ID of the compaction item. + - `"gpt-5-2025-08-07"` - - `ImageGenerationCall object { id, result, status, type }` + - `"gpt-5-mini-2025-08-07"` - An image generation request made by the model. + - `"gpt-5-nano-2025-08-07"` - - `id: string` + - `"gpt-5-chat-latest"` - The unique ID of the image generation call. + - `"gpt-4.1"` - - `result: string` + - `"gpt-4.1-mini"` - The generated image encoded in base64. + - `"gpt-4.1-nano"` - - `status: "in_progress" or "completed" or "generating" or "failed"` + - `"gpt-4.1-2025-04-14"` - The status of the image generation call. + - `"gpt-4.1-mini-2025-04-14"` - - `"in_progress"` + - `"gpt-4.1-nano-2025-04-14"` - - `"completed"` + - `"o4-mini"` - - `"generating"` + - `"o4-mini-2025-04-16"` - - `"failed"` + - `"o3"` - - `type: "image_generation_call"` + - `"o3-2025-04-16"` - The type of the image generation call. Always `image_generation_call`. + - `"o3-mini"` - - `"image_generation_call"` + - `"o3-mini-2025-01-31"` - - `CodeInterpreterCall object { id, code, container_id, 3 more }` + - `"o1"` - A tool call to run code. + - `"o1-2024-12-17"` - - `id: string` + - `"o1-preview"` - The unique ID of the code interpreter tool call. + - `"o1-preview-2024-09-12"` - - `code: string` + - `"o1-mini"` - The code to run, or null if not available. + - `"o1-mini-2024-09-12"` - - `container_id: string` + - `"gpt-4o"` - The ID of the container used to run the code. + - `"gpt-4o-2024-11-20"` - - `outputs: array of object { logs, type } or object { type, url }` + - `"gpt-4o-2024-08-06"` - The outputs generated by the code interpreter, such as logs or images. - Can be null if no outputs are available. + - `"gpt-4o-2024-05-13"` - - `Logs object { logs, type }` + - `"gpt-4o-audio-preview"` - The logs output from the code interpreter. + - `"gpt-4o-audio-preview-2024-10-01"` - - `logs: string` + - `"gpt-4o-audio-preview-2024-12-17"` - The logs output from the code interpreter. + - `"gpt-4o-audio-preview-2025-06-03"` - - `type: "logs"` + - `"gpt-4o-mini-audio-preview"` - The type of the output. Always `logs`. + - `"gpt-4o-mini-audio-preview-2024-12-17"` - - `"logs"` + - `"gpt-4o-search-preview"` - - `Image object { type, url }` + - `"gpt-4o-mini-search-preview"` - The image output from the code interpreter. + - `"gpt-4o-search-preview-2025-03-11"` - - `type: "image"` + - `"gpt-4o-mini-search-preview-2025-03-11"` - The type of the output. Always `image`. + - `"chatgpt-4o-latest"` - - `"image"` + - `"codex-mini-latest"` - - `url: string` + - `"gpt-4o-mini"` - The URL of the image output from the code interpreter. + - `"gpt-4o-mini-2024-07-18"` - - `status: "in_progress" or "completed" or "incomplete" or 2 more` + - `"gpt-4-turbo"` - The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + - `"gpt-4-turbo-2024-04-09"` - - `"in_progress"` + - `"gpt-4-0125-preview"` - - `"completed"` + - `"gpt-4-turbo-preview"` - - `"incomplete"` + - `"gpt-4-1106-preview"` - - `"interpreting"` + - `"gpt-4-vision-preview"` - - `"failed"` + - `"gpt-4"` - - `type: "code_interpreter_call"` + - `"gpt-4-0314"` - The type of the code interpreter tool call. Always `code_interpreter_call`. + - `"gpt-4-0613"` - - `"code_interpreter_call"` + - `"gpt-4-32k"` - - `LocalShellCall object { id, action, call_id, 2 more }` + - `"gpt-4-32k-0314"` - A tool call to run a command on the local shell. + - `"gpt-4-32k-0613"` - - `id: string` + - `"gpt-3.5-turbo"` - The unique ID of the local shell call. + - `"gpt-3.5-turbo-16k"` - - `action: object { command, env, type, 3 more }` + - `"gpt-3.5-turbo-0301"` - Execute a shell command on the server. + - `"gpt-3.5-turbo-0613"` - - `command: array of string` + - `"gpt-3.5-turbo-1106"` - The command to run. + - `"gpt-3.5-turbo-0125"` - - `env: map[string]` + - `"gpt-3.5-turbo-16k-0613"` - Environment variables to set for the command. + - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more` - - `type: "exec"` + - `"o1-pro"` - The type of the local shell action. Always `exec`. + - `"o1-pro-2025-03-19"` - - `"exec"` + - `"o3-pro"` - - `timeout_ms: optional number` + - `"o3-pro-2025-06-10"` - Optional timeout in milliseconds for the command. + - `"o3-deep-research"` - - `user: optional string` + - `"o3-deep-research-2025-06-26"` - Optional user to run the command as. + - `"o4-mini-deep-research"` - - `working_directory: optional string` + - `"o4-mini-deep-research-2025-06-26"` - Optional working directory to run the command in. + - `"computer-use-preview"` - - `call_id: string` + - `"computer-use-preview-2025-03-11"` - The unique ID of the local shell tool call generated by the model. + - `"gpt-5-codex"` - - `status: "in_progress" or "completed" or "incomplete"` + - `"gpt-5-pro"` - The status of the local shell call. + - `"gpt-5-pro-2025-10-06"` - - `"in_progress"` + - `"gpt-5.1-codex-max"` - - `"completed"` + - `object: "response"` - - `"incomplete"` + The object type of this resource - always set to `response`. - - `type: "local_shell_call"` + - `"response"` - The type of the local shell call. Always `local_shell_call`. + - `output: array of ResponseOutputItem` - - `"local_shell_call"` + An array of content items generated by the model. - - `LocalShellCallOutput object { id, output, type, status }` + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. - The output of a local shell tool call. + - `ResponseOutputMessage object { id, content, role, 3 more }` - - `id: string` + An output message from the model. - The unique ID of the local shell tool call generated by the model. + - `FileSearchCall object { id, queries, status, 2 more }` - - `output: string` + The results of a file search tool call. See the + [file search guide](/docs/guides/tools-file-search) for more information. - A JSON string of the output of the local shell tool call. + - `id: string` - - `type: "local_shell_call_output"` + The unique ID of the file search tool call. - The type of the local shell tool call output. Always `local_shell_call_output`. + - `queries: array of string` - - `"local_shell_call_output"` + The queries used to search for files. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "searching" or "completed" or 2 more` - The status of the item. One of `in_progress`, `completed`, or `incomplete`. + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, - `"in_progress"` + - `"searching"` + - `"completed"` - `"incomplete"` - - `ShellCall object { action, call_id, type, 3 more }` - - A tool representing a request to execute one or more shell commands. + - `"failed"` - - `action: object { commands, max_output_length, timeout_ms }` + - `type: "file_search_call"` - The shell commands and limits that describe how to run the tool call. + The type of the file search tool call. Always `file_search_call`. - - `commands: array of string` + - `"file_search_call"` - Ordered shell commands for the execution environment to run. + - `results: optional array of object { attributes, file_id, filename, 2 more }` - - `max_output_length: optional number` + The results of the file search tool call. - Maximum number of UTF-8 characters to capture from combined stdout and stderr output. + - `attributes: optional map[string or number or boolean]` - - `timeout_ms: optional number` + 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. - Maximum wall-clock time in milliseconds to allow the shell commands to run. + - `string` - - `call_id: string` + - `number` - The unique ID of the shell tool call generated by the model. + - `boolean` - - `type: "shell_call"` + - `file_id: optional string` - The type of the item. Always `shell_call`. + The unique ID of the file. - - `"shell_call"` + - `filename: optional string` - - `id: optional string` + The name of the file. - The unique ID of the shell tool call. Populated when this item is returned via API. + - `score: optional number` - - `environment: optional LocalEnvironment or ContainerReference` + The relevance score of the file - a value between 0 and 1. - The environment to execute the shell commands in. + - `text: optional string` - - `LocalEnvironment object { type, skills }` + The text that was retrieved from the file. - - `ContainerReference object { container_id, type }` + - `FunctionCall object { arguments, call_id, name, 4 more }` - - `status: optional "in_progress" or "completed" or "incomplete"` + A tool call to run a function. See the + [function calling guide](/docs/guides/function-calling) for more information. - The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + - `arguments: string` - - `"in_progress"` + A JSON string of the arguments to pass to the function. - - `"completed"` + - `call_id: string` - - `"incomplete"` + The unique ID of the function tool call generated by the model. - - `ShellCallOutput object { call_id, output, type, 3 more }` + - `name: string` - The streamed output items emitted by a shell tool call. + The name of the function to run. - - `call_id: string` + - `type: "function_call"` - The unique ID of the shell tool call generated by the model. + The type of the function tool call. Always `function_call`. - - `output: array of ResponseFunctionShellCallOutputContent` + - `"function_call"` - Captured chunks of stdout and stderr output, along with their associated outcomes. + - `id: optional string` - - `outcome: object { type } or object { exit_code, type }` + The unique ID of the function tool call. - The exit or timeout outcome associated with this shell call. + - `namespace: optional string` - - `Timeout object { type }` + The namespace of the function to run. - Indicates that the shell call exceeded its configured time limit. + - `status: optional "in_progress" or "completed" or "incomplete"` - - `type: "timeout"` + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - The outcome type. Always `timeout`. + - `"in_progress"` - - `"timeout"` + - `"completed"` - - `Exit object { exit_code, type }` + - `"incomplete"` - Indicates that the shell commands finished and returned an exit code. + - `FunctionCallOutput object { id, call_id, output, 3 more }` - - `exit_code: number` + - `id: string` - The exit code returned by the shell process. + The unique ID of the function call tool output. - - `type: "exit"` + - `call_id: string` - The outcome type. Always `exit`. + The unique ID of the function tool call generated by the model. - - `"exit"` + - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` - - `stderr: string` + The output from the function call generated by your code. + Can be a string or an list of output content. - Captured stderr output for the shell call. + - `StringOutput = string` - - `stdout: string` + A string of the output of the function call. - Captured stdout output for the shell call. + - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` - - `type: "shell_call_output"` + Text, image, or file output of the function call. - The type of the item. Always `shell_call_output`. + - `ResponseInputText object { text, type }` - - `"shell_call_output"` + A text input to the model. - - `id: optional string` + - `ResponseInputImage object { detail, type, file_id, image_url }` - The unique ID of the shell tool call output. Populated when this item is returned via API. + An image input to the model. Learn about [image inputs](/docs/guides/vision). - - `max_output_length: optional number` + - `ResponseInputFile object { type, detail, file_data, 3 more }` - The maximum number of UTF-8 characters captured for this shell call's combined output. + A file input to the model. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `status: "in_progress" or "completed" or "incomplete"` - The status of the shell call output. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - `"in_progress"` @@ -6887,252 +9118,273 @@ as input for the model's response. - `"incomplete"` - - `ApplyPatchCall object { call_id, operation, status, 2 more }` + - `type: "function_call_output"` - A tool call representing a request to create, delete, or update files using diff patches. + The type of the function tool call output. Always `function_call_output`. - - `call_id: string` + - `"function_call_output"` - The unique ID of the apply patch tool call generated by the model. + - `created_by: optional string` - - `operation: object { diff, path, type } or object { path, type } or object { diff, path, type }` + The identifier of the actor that created the item. - The specific create, delete, or update instruction for the apply_patch tool call. + - `WebSearchCall object { id, action, status, type }` - - `CreateFile object { diff, path, type }` + The results of a web search tool call. See the + [web search guide](/docs/guides/tools-web-search) for more information. - Instruction for creating a new file via the apply_patch tool. + - `id: string` - - `diff: string` + The unique ID of the web search tool call. - Unified diff content to apply when creating the file. + - `action: object { type, queries, query, sources } or object { type, url } or object { pattern, type, url }` - - `path: string` + 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). - Path of the file to create relative to the workspace root. + - `Search object { type, queries, query, sources }` - - `type: "create_file"` + Action type "search" - Performs a web search query. - The operation type. Always `create_file`. + - `type: "search"` - - `"create_file"` + The action type. - - `DeleteFile object { path, type }` + - `"search"` - Instruction for deleting an existing file via the apply_patch tool. + - `queries: optional array of string` - - `path: string` + The search queries. - Path of the file to delete relative to the workspace root. + - `query: optional string` - - `type: "delete_file"` + The search query. - The operation type. Always `delete_file`. + - `sources: optional array of object { type, url }` - - `"delete_file"` + The sources used in the search. - - `UpdateFile object { diff, path, type }` + - `type: "url"` - Instruction for updating an existing file via the apply_patch tool. + The type of source. Always `url`. - - `diff: string` + - `"url"` - Unified diff content to apply to the existing file. + - `url: string` - - `path: string` + The URL of the source. - Path of the file to update relative to the workspace root. + - `OpenPage object { type, url }` - - `type: "update_file"` + Action type "open_page" - Opens a specific URL from search results. - The operation type. Always `update_file`. + - `type: "open_page"` - - `"update_file"` + The action type. - - `status: "in_progress" or "completed"` + - `"open_page"` - The status of the apply patch tool call. One of `in_progress` or `completed`. + - `url: optional string` - - `"in_progress"` + The URL opened by the model. - - `"completed"` + - `FindInPage object { pattern, type, url }` - - `type: "apply_patch_call"` + Action type "find_in_page": Searches for a pattern within a loaded page. - The type of the item. Always `apply_patch_call`. + - `pattern: string` - - `"apply_patch_call"` + The pattern or text to search for within the page. - - `id: optional string` + - `type: "find_in_page"` - The unique ID of the apply patch tool call. Populated when this item is returned via API. + The action type. - - `ApplyPatchCallOutput object { call_id, status, type, 2 more }` + - `"find_in_page"` - The streamed output emitted by an apply patch tool call. + - `url: string` - - `call_id: string` + The URL of the page searched for the pattern. - The unique ID of the apply patch tool call generated by the model. + - `status: "in_progress" or "searching" or "completed" or "failed"` - - `status: "completed" or "failed"` + The status of the web search tool call. - The status of the apply patch tool call output. One of `completed` or `failed`. + - `"in_progress"` + + - `"searching"` - `"completed"` - `"failed"` - - `type: "apply_patch_call_output"` + - `type: "web_search_call"` - The type of the item. Always `apply_patch_call_output`. + The type of the web search tool call. Always `web_search_call`. - - `"apply_patch_call_output"` + - `"web_search_call"` - - `id: optional string` + - `ComputerCall object { id, call_id, pending_safety_checks, 4 more }` - The unique ID of the apply patch tool call output. Populated when this item is returned via API. + A tool call to a computer use tool. See the + [computer use guide](/docs/guides/tools-computer-use) for more information. - - `output: optional string` + - `id: string` - Optional human-readable log text from the apply patch tool (e.g., patch results or errors). + The unique ID of the computer call. - - `McpListTools object { id, server_label, tools, 2 more }` + - `call_id: string` - A list of tools available on an MCP server. + An identifier used when responding to the tool call with output. - - `id: string` + - `pending_safety_checks: array of object { id, code, message }` - The unique ID of the list. + The pending safety checks for the computer call. - - `server_label: string` + - `id: string` - The label of the MCP server. + The ID of the pending safety check. - - `tools: array of object { input_schema, name, annotations, description }` + - `code: optional string` - The tools available on the server. + The type of the pending safety check. - - `input_schema: unknown` + - `message: optional string` - The JSON schema describing the tool's input. + Details about the pending safety check. - - `name: string` + - `status: "in_progress" or "completed" or "incomplete"` - The name of the tool. + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. - - `annotations: optional unknown` + - `"in_progress"` - Additional annotations about the tool. + - `"completed"` - - `description: optional string` + - `"incomplete"` - The description of the tool. + - `type: "computer_call"` - - `type: "mcp_list_tools"` + The type of the computer call. Always `computer_call`. - The type of the item. Always `mcp_list_tools`. + - `"computer_call"` - - `"mcp_list_tools"` + - `action: optional ComputerAction` - - `error: optional string` + A click action. - Error message if the server could not list tools. + - `actions: optional ComputerActionList` - - `McpApprovalRequest object { id, arguments, name, 2 more }` + Flattened batched actions for `computer_use`. Each action includes an + `type` discriminator and action-specific fields. - A request for human approval of a tool invocation. + - `ComputerCallOutput object { id, call_id, output, 4 more }` - `id: string` - The unique ID of the approval request. + The unique ID of the computer call tool output. - - `arguments: string` + - `call_id: string` - A JSON string of arguments for the tool. + The ID of the computer tool call that produced the output. - - `name: string` + - `output: ResponseComputerToolCallOutputScreenshot` - The name of the tool to run. + A computer screenshot image used with the computer use tool. - - `server_label: string` + - `status: "completed" or "incomplete" or "failed" or "in_progress"` - The label of the MCP server making the request. + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. - - `type: "mcp_approval_request"` + - `"completed"` - The type of the item. Always `mcp_approval_request`. + - `"incomplete"` - - `"mcp_approval_request"` + - `"failed"` - - `McpApprovalResponse object { approval_request_id, approve, type, 2 more }` + - `"in_progress"` - A response to an MCP approval request. + - `type: "computer_call_output"` - - `approval_request_id: string` + The type of the computer tool call output. Always `computer_call_output`. - The ID of the approval request being answered. + - `"computer_call_output"` - - `approve: boolean` + - `acknowledged_safety_checks: optional array of object { id, code, message }` - Whether the request was approved. + The safety checks reported by the API that have been acknowledged by the + developer. - - `type: "mcp_approval_response"` + - `id: string` - The type of the item. Always `mcp_approval_response`. + The ID of the pending safety check. - - `"mcp_approval_response"` + - `code: optional string` - - `id: optional string` + The type of the pending safety check. - The unique ID of the approval response + - `message: optional string` - - `reason: optional string` + Details about the pending safety check. - Optional reason for the decision. + - `created_by: optional string` - - `McpCall object { id, arguments, name, 6 more }` + The identifier of the actor that created the item. - An invocation of a tool on an MCP server. + - `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](/docs/guides/conversation-state). - `id: string` - The unique ID of the tool call. + The unique identifier of the reasoning content. - - `arguments: string` + - `summary: array of SummaryTextContent` - A JSON string of the arguments passed to the tool. + Reasoning summary content. - - `name: string` + - `text: string` - The name of the tool that was run. + A summary of the reasoning output from the model so far. - - `server_label: string` + - `type: "summary_text"` - The label of the MCP server running the tool. + The type of the object. Always `summary_text`. - - `type: "mcp_call"` + - `type: "reasoning"` - The type of the item. Always `mcp_call`. + The type of the object. Always `reasoning`. - - `"mcp_call"` + - `"reasoning"` - - `approval_request_id: optional string` + - `content: optional array of object { text, type }` - 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. + Reasoning text content. - - `error: optional string` + - `text: string` - The error from the tool call, if any. + The reasoning text from the model. - - `output: optional string` + - `type: "reasoning_text"` - The output from the tool call. + The type of the reasoning text. Always `reasoning_text`. - - `status: optional "in_progress" or "completed" or "incomplete" or 2 more` + - `"reasoning_text"` - The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + - `encrypted_content: optional string` + + The encrypted content of the reasoning item - populated when a response is + generated with `reasoning.encrypted_content` in the `include` parameter. + + - `status: optional "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. - `"in_progress"` @@ -7140,837 +9392,841 @@ as input for the model's response. - `"incomplete"` - - `"calling"` + - `ToolSearchCall object { id, arguments, call_id, 4 more }` - - `"failed"` + - `id: string` - - `CustomToolCallOutput object { call_id, output, type, id }` + The unique ID of the tool search call item. - The output of a custom tool call from your code, being sent back to the model. + - `arguments: unknown` + + Arguments used for the tool search call. - `call_id: string` - The call ID, used to map this custom tool call output to a custom tool call. + The unique ID of the tool search call generated by the model. - - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` + - `execution: "server" or "client"` - The output from the custom tool call generated by your code. - Can be a string or an list of output content. + Whether tool search was executed by the server or by the client. - - `StringOutput = string` + - `"server"` - A string of the output of the custom tool call. + - `"client"` - - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` + - `status: "in_progress" or "completed" or "incomplete"` - Text, image, or file output of the custom tool call. + The status of the tool search call item that was recorded. - - `ResponseInputText object { text, type }` + - `"in_progress"` - A text input to the model. + - `"completed"` - - `ResponseInputImage object { detail, type, file_id, image_url }` + - `"incomplete"` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + - `type: "tool_search_call"` - - `ResponseInputFile object { type, detail, file_data, 3 more }` + The type of the item. Always `tool_search_call`. - A file input to the model. + - `"tool_search_call"` - - `type: "custom_tool_call_output"` + - `created_by: optional string` - The type of the custom tool call output. Always `custom_tool_call_output`. + The identifier of the actor that created the item. - - `"custom_tool_call_output"` + - `ToolSearchOutput object { id, call_id, execution, 4 more }` - - `id: optional string` + - `id: string` - The unique ID of the custom tool call output in the OpenAI platform. + The unique ID of the tool search output item. - - `CustomToolCall object { call_id, input, name, 3 more }` + - `call_id: string` - A call to a custom tool created by the model. + The unique ID of the tool search call generated by the model. - - `call_id: string` + - `execution: "server" or "client"` - An identifier used to map this custom tool call to a tool call output. + Whether tool search was executed by the server or by the client. - - `input: string` + - `"server"` - The input for the custom tool call generated by the model. + - `"client"` - - `name: string` + - `status: "in_progress" or "completed" or "incomplete"` - The name of the custom tool being called. + The status of the tool search output item that was recorded. - - `type: "custom_tool_call"` + - `"in_progress"` - The type of the custom tool call. Always `custom_tool_call`. + - `"completed"` - - `"custom_tool_call"` + - `"incomplete"` - - `id: optional string` + - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` - The unique ID of the custom tool call in the OpenAI platform. + The loaded tool definitions returned by tool search. - - `namespace: optional string` + - `Function object { name, parameters, strict, 3 more }` - The namespace of the custom tool being called. + Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - - `CompactionTrigger object { type }` + - `name: string` - Compacts the current context. Must be the final input item. + The name of the function to call. - - `type: "compaction_trigger"` + - `parameters: map[unknown]` - The type of the item. Always `compaction_trigger`. + A JSON schema object describing the parameters of the function. + + - `strict: boolean` + + Whether to enforce strict parameter validation. Default `true`. + + - `type: "function"` - - `"compaction_trigger"` + The type of the function tool. Always `function`. - - `ItemReference object { id, type }` + - `"function"` - An internal identifier for an item to reference. + - `defer_loading: optional boolean` - - `id: string` + Whether this function is deferred and loaded via tool search. - The ID of the item to reference. + - `description: optional string` - - `type: optional "item_reference"` + A description of the function. Used by the model to determine whether or not to call the function. - The type of item to reference. Always `item_reference`. + - `FileSearch object { type, vector_store_ids, filters, 2 more }` - - `"item_reference"` + A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - - `metadata: Metadata` + - `type: "file_search"` - 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. + The type of the file search tool. Always `file_search`. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. + - `"file_search"` - - `model: ResponsesModel` + - `vector_store_ids: array of string` - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](/docs/models) - to browse and compare available models. + The IDs of the vector stores to search. - - `string` + - `filters: optional ComparisonFilter or CompoundFilter` - - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more` + A filter to apply. - - `"gpt-5.4"` + - `ComparisonFilter object { key, type, value }` - - `"gpt-5.4-mini"` + A filter used to compare a specified attribute key to a given value using a defined comparison operation. - - `"gpt-5.4-nano"` + - `CompoundFilter object { filters, type }` - - `"gpt-5.4-mini-2026-03-17"` + Combine multiple filters using `and` or `or`. - - `"gpt-5.4-nano-2026-03-17"` + - `max_num_results: optional number` - - `"gpt-5.3-chat-latest"` + The maximum number of results to return. This number should be between 1 and 50 inclusive. - - `"gpt-5.2"` + - `ranking_options: optional object { hybrid_search, ranker, score_threshold }` - - `"gpt-5.2-2025-12-11"` + Ranking options for search. - - `"gpt-5.2-chat-latest"` + - `hybrid_search: optional object { embedding_weight, text_weight }` - - `"gpt-5.2-pro"` + Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - - `"gpt-5.2-pro-2025-12-11"` + - `embedding_weight: number` - - `"gpt-5.1"` + The weight of the embedding in the reciprocal ranking fusion. - - `"gpt-5.1-2025-11-13"` + - `text_weight: number` - - `"gpt-5.1-codex"` + The weight of the text in the reciprocal ranking fusion. - - `"gpt-5.1-mini"` + - `ranker: optional "auto" or "default-2024-11-15"` - - `"gpt-5.1-chat-latest"` + The ranker to use for the file search. - - `"gpt-5"` + - `"auto"` - - `"gpt-5-mini"` + - `"default-2024-11-15"` - - `"gpt-5-nano"` + - `score_threshold: optional number` - - `"gpt-5-2025-08-07"` + 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. - - `"gpt-5-mini-2025-08-07"` + - `Computer object { type }` - - `"gpt-5-nano-2025-08-07"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `"gpt-5-chat-latest"` + - `type: "computer"` - - `"gpt-4.1"` + The type of the computer tool. Always `computer`. - - `"gpt-4.1-mini"` + - `"computer"` - - `"gpt-4.1-nano"` + - `ComputerUsePreview object { display_height, display_width, environment, type }` - - `"gpt-4.1-2025-04-14"` + A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - - `"gpt-4.1-mini-2025-04-14"` + - `display_height: number` - - `"gpt-4.1-nano-2025-04-14"` + The height of the computer display. - - `"o4-mini"` + - `display_width: number` - - `"o4-mini-2025-04-16"` + The width of the computer display. - - `"o3"` + - `environment: "windows" or "mac" or "linux" or 2 more` - - `"o3-2025-04-16"` + The type of computer environment to control. - - `"o3-mini"` + - `"windows"` - - `"o3-mini-2025-01-31"` + - `"mac"` - - `"o1"` + - `"linux"` - - `"o1-2024-12-17"` + - `"ubuntu"` - - `"o1-preview"` + - `"browser"` - - `"o1-preview-2024-09-12"` + - `type: "computer_use_preview"` - - `"o1-mini"` + The type of the computer use tool. Always `computer_use_preview`. - - `"o1-mini-2024-09-12"` + - `"computer_use_preview"` - - `"gpt-4o"` + - `WebSearch object { type, filters, search_context_size, user_location }` - - `"gpt-4o-2024-11-20"` + Search the Internet for sources related to the prompt. Learn more about the + [web search tool](/docs/guides/tools-web-search). - - `"gpt-4o-2024-08-06"` + - `type: "web_search" or "web_search_2025_08_26"` - - `"gpt-4o-2024-05-13"` + The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - - `"gpt-4o-audio-preview"` + - `"web_search"` - - `"gpt-4o-audio-preview-2024-10-01"` + - `"web_search_2025_08_26"` - - `"gpt-4o-audio-preview-2024-12-17"` + - `filters: optional object { allowed_domains }` - - `"gpt-4o-audio-preview-2025-06-03"` + Filters for the search. - - `"gpt-4o-mini-audio-preview"` + - `allowed_domains: optional array of string` - - `"gpt-4o-mini-audio-preview-2024-12-17"` + Allowed domains for the search. If not provided, all domains are allowed. + Subdomains of the provided domains are allowed as well. - - `"gpt-4o-search-preview"` + Example: `["pubmed.ncbi.nlm.nih.gov"]` - - `"gpt-4o-mini-search-preview"` + - `search_context_size: optional "low" or "medium" or "high"` - - `"gpt-4o-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. - - `"gpt-4o-mini-search-preview-2025-03-11"` + - `"low"` - - `"chatgpt-4o-latest"` + - `"medium"` - - `"codex-mini-latest"` + - `"high"` - - `"gpt-4o-mini"` + - `user_location: optional object { city, country, region, 2 more }` - - `"gpt-4o-mini-2024-07-18"` + The approximate location of the user. - - `"gpt-4-turbo"` + - `city: optional string` - - `"gpt-4-turbo-2024-04-09"` + Free text input for the city of the user, e.g. `San Francisco`. - - `"gpt-4-0125-preview"` + - `country: optional string` - - `"gpt-4-turbo-preview"` + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `"gpt-4-1106-preview"` + - `region: optional string` - - `"gpt-4-vision-preview"` + Free text input for the region of the user, e.g. `California`. - - `"gpt-4"` + - `timezone: optional string` - - `"gpt-4-0314"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `"gpt-4-0613"` + - `type: optional "approximate"` - - `"gpt-4-32k"` + The type of location approximation. Always `approximate`. - - `"gpt-4-32k-0314"` + - `"approximate"` - - `"gpt-4-32k-0613"` + - `Mcp object { server_label, type, allowed_tools, 7 more }` - - `"gpt-3.5-turbo"` + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](/docs/guides/tools-remote-mcp). - - `"gpt-3.5-turbo-16k"` + - `server_label: string` - - `"gpt-3.5-turbo-0301"` + A label for this MCP server, used to identify it in tool calls. - - `"gpt-3.5-turbo-0613"` + - `type: "mcp"` - - `"gpt-3.5-turbo-1106"` + The type of the MCP tool. Always `mcp`. - - `"gpt-3.5-turbo-0125"` + - `"mcp"` - - `"gpt-3.5-turbo-16k-0613"` + - `allowed_tools: optional array of string or object { read_only, tool_names }` - - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more` + List of allowed tool names or a filter object. - - `"o1-pro"` + - `McpAllowedTools = array of string` - - `"o1-pro-2025-03-19"` + A string array of allowed tool names - - `"o3-pro"` + - `McpToolFilter object { read_only, tool_names }` - - `"o3-pro-2025-06-10"` + A filter object to specify which tools are allowed. - - `"o3-deep-research"` + - `read_only: optional boolean` - - `"o3-deep-research-2025-06-26"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `"o4-mini-deep-research"` + - `tool_names: optional array of string` - - `"o4-mini-deep-research-2025-06-26"` + List of allowed tool names. - - `"computer-use-preview"` + - `authorization: optional string` - - `"computer-use-preview-2025-03-11"` + 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. - - `"gpt-5-codex"` + - `connector_id: optional "connector_dropbox" or "connector_gmail" or "connector_googlecalendar" or 5 more` - - `"gpt-5-pro"` + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](/docs/guides/tools-remote-mcp#connectors). - - `"gpt-5-pro-2025-10-06"` + Currently supported `connector_id` values are: - - `"gpt-5.1-codex-max"` + - 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` - - `object: "response"` + - `"connector_dropbox"` - The object type of this resource - always set to `response`. + - `"connector_gmail"` - - `"response"` + - `"connector_googlecalendar"` - - `output: array of ResponseOutputItem` + - `"connector_googledrive"` - An array of content items generated by the model. + - `"connector_microsoftteams"` - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. + - `"connector_outlookcalendar"` - - `ResponseOutputMessage object { id, content, role, 3 more }` + - `"connector_outlookemail"` - An output message from the model. + - `"connector_sharepoint"` - - `FileSearchCall object { id, queries, status, 2 more }` + - `defer_loading: optional boolean` - The results of a file search tool call. See the - [file search guide](/docs/guides/tools-file-search) for more information. + Whether this MCP tool is deferred and discovered via tool search. - - `id: string` + - `headers: optional map[string]` - The unique ID of the file search tool call. + Optional HTTP headers to send to the MCP server. Use for authentication + or other purposes. - - `queries: array of string` + - `require_approval: optional object { always, never } or "always" or "never"` - The queries used to search for files. + Specify which of the MCP server's tools require approval. - - `status: "in_progress" or "searching" or "completed" or 2 more` + - `McpToolApprovalFilter object { always, never }` - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, + Specify which of the MCP server's tools require approval. Can be + `always`, `never`, or a filter object associated with tools + that require approval. - - `"in_progress"` + - `always: optional object { read_only, tool_names }` - - `"searching"` + A filter object to specify which tools are allowed. - - `"completed"` + - `read_only: optional boolean` - - `"incomplete"` + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `"failed"` + - `tool_names: optional array of string` - - `type: "file_search_call"` + List of allowed tool names. - The type of the file search tool call. Always `file_search_call`. + - `never: optional object { read_only, tool_names }` - - `"file_search_call"` + A filter object to specify which tools are allowed. - - `results: optional array of object { attributes, file_id, filename, 2 more }` + - `read_only: optional boolean` - The results of the file search tool call. + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. - - `attributes: optional map[string or number or boolean]` + - `tool_names: optional array of string` - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. + List of allowed tool names. - - `string` + - `McpToolApprovalSetting = "always" or "never"` - - `number` + 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. - - `boolean` + - `"always"` - - `file_id: optional string` + - `"never"` - The unique ID of the file. + - `server_description: optional string` - - `filename: optional string` + Optional description of the MCP server, used to provide more context. - The name of the file. + - `server_url: optional string` - - `score: optional number` + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. - The relevance score of the file - a value between 0 and 1. + - `CodeInterpreter object { container, type }` - - `text: optional string` + A tool that runs Python code to help generate a response to a prompt. - The text that was retrieved from the file. + - `container: string or object { type, file_ids, memory_limit, network_policy }` - - `FunctionCall object { arguments, call_id, name, 4 more }` + 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. - A tool call to run a function. See the - [function calling guide](/docs/guides/function-calling) for more information. + - `string` - - `arguments: string` + The container ID. - A JSON string of the arguments to pass to the function. + - `CodeInterpreterToolAuto object { type, file_ids, memory_limit, network_policy }` - - `call_id: string` + Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - The unique ID of the function tool call generated by the model. + - `type: "auto"` - - `name: string` + Always `auto`. - The name of the function to run. + - `"auto"` - - `type: "function_call"` + - `file_ids: optional array of string` - The type of the function tool call. Always `function_call`. + An optional list of uploaded files to make available to your code. - - `"function_call"` + - `memory_limit: optional "1g" or "4g" or "16g" or "64g"` - - `id: optional string` + The memory limit for the code interpreter container. - The unique ID of the function tool call. + - `"1g"` - - `namespace: optional string` + - `"4g"` - The namespace of the function to run. + - `"16g"` - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"64g"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `network_policy: optional ContainerNetworkPolicyDisabled or ContainerNetworkPolicyAllowlist` - - `"in_progress"` + Network access policy for the container. - - `"completed"` + - `ContainerNetworkPolicyDisabled object { type }` - - `"incomplete"` + - `ContainerNetworkPolicyAllowlist object { allowed_domains, type, domain_secrets }` - - `FunctionCallOutput object { id, call_id, output, 3 more }` + - `type: "code_interpreter"` - - `id: string` + The type of the code interpreter tool. Always `code_interpreter`. - The unique ID of the function call tool output. + - `"code_interpreter"` - - `call_id: string` + - `ImageGeneration object { type, action, background, 9 more }` - The unique ID of the function tool call generated by the model. + A tool that generates images using the GPT image models. - - `output: string or array of ResponseInputText or ResponseInputImage or ResponseInputFile` + - `type: "image_generation"` - The output from the function call generated by your code. - Can be a string or an list of output content. + The type of the image generation tool. Always `image_generation`. - - `StringOutput = string` + - `"image_generation"` - A string of the output of the function call. + - `action: optional "generate" or "edit" or "auto"` - - `OutputContentList = array of ResponseInputText or ResponseInputImage or ResponseInputFile` + Whether to generate a new image or edit an existing image. Default: `auto`. - Text, image, or file output of the function call. + - `"generate"` - - `ResponseInputText object { text, type }` + - `"edit"` - A text input to the model. + - `"auto"` - - `ResponseInputImage object { detail, type, file_id, image_url }` + - `background: optional "transparent" or "opaque" or "auto"` - An image input to the model. Learn about [image inputs](/docs/guides/vision). + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. - - `ResponseInputFile object { type, detail, file_data, 3 more }` + - `"transparent"` - A file input to the model. + - `"opaque"` - - `status: "in_progress" or "completed" or "incomplete"` + - `"auto"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `input_fidelity: optional "high" or "low"` - - `"in_progress"` + 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`. - - `"completed"` + - `"high"` - - `"incomplete"` + - `"low"` - - `type: "function_call_output"` + - `input_image_mask: optional object { file_id, image_url }` - The type of the function tool call output. Always `function_call_output`. + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). - - `"function_call_output"` + - `file_id: optional string` - - `created_by: optional string` + File ID for the mask image. - The identifier of the actor that created the item. + - `image_url: optional string` - - `WebSearchCall object { id, action, status, type }` + Base64-encoded mask image. - The results of a web search tool call. See the - [web search guide](/docs/guides/tools-web-search) for more information. + - `model: optional string or "gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - - `id: string` + The image generation model to use. Default: `gpt-image-1`. - The unique ID of the web search tool call. + - `string` - - `action: object { query, type, queries, sources } or object { type, url } or object { pattern, type, url }` + - `"gpt-image-1" or "gpt-image-1-mini" or "gpt-image-1.5"` - 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). + The image generation model to use. Default: `gpt-image-1`. - - `Search object { query, type, queries, sources }` + - `"gpt-image-1"` - Action type "search" - Performs a web search query. + - `"gpt-image-1-mini"` - - `query: string` + - `"gpt-image-1.5"` - [DEPRECATED] The search query. + - `moderation: optional "auto" or "low"` - - `type: "search"` + Moderation level for the generated image. Default: `auto`. - The action type. + - `"auto"` - - `"search"` + - `"low"` - - `queries: optional array of string` + - `output_compression: optional number` - The search queries. + Compression level for the output image. Default: 100. - - `sources: optional array of object { type, url }` + - `output_format: optional "png" or "webp" or "jpeg"` - The sources used in the search. + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. - - `type: "url"` + - `"png"` - The type of source. Always `url`. + - `"webp"` - - `"url"` + - `"jpeg"` - - `url: string` + - `partial_images: optional number` - The URL of the source. + Number of partial images to generate in streaming mode, from 0 (default value) to 3. - - `OpenPage object { type, url }` + - `quality: optional "low" or "medium" or "high" or "auto"` - Action type "open_page" - Opens a specific URL from search results. + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. - - `type: "open_page"` + - `"low"` - The action type. + - `"medium"` - - `"open_page"` + - `"high"` - - `url: optional string` + - `"auto"` - The URL opened by the model. + - `size: optional string or "1024x1024" or "1024x1536" or "1536x1024" or "auto"` - - `FindInPage object { pattern, type, url }` + 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`. - Action type "find_in_page": Searches for a pattern within a loaded page. + - `string` - - `pattern: string` + - `"1024x1024" or "1024x1536" or "1536x1024" or "auto"` - The pattern or text to search for within the page. + 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`. - - `type: "find_in_page"` + - `"1024x1024"` - The action type. + - `"1024x1536"` - - `"find_in_page"` + - `"1536x1024"` - - `url: string` + - `"auto"` - The URL of the page searched for the pattern. + - `LocalShell object { type }` - - `status: "in_progress" or "searching" or "completed" or "failed"` + A tool that allows the model to execute shell commands in a local environment. - The status of the web search tool call. + - `type: "local_shell"` - - `"in_progress"` + The type of the local shell tool. Always `local_shell`. - - `"searching"` + - `"local_shell"` - - `"completed"` + - `Shell object { type, environment }` - - `"failed"` + A tool that allows the model to execute shell commands. - - `type: "web_search_call"` + - `type: "shell"` - The type of the web search tool call. Always `web_search_call`. + The type of the shell tool. Always `shell`. - - `"web_search_call"` + - `"shell"` - - `ComputerCall object { id, call_id, pending_safety_checks, 4 more }` + - `environment: optional ContainerAuto or LocalEnvironment or ContainerReference` - A tool call to a computer use tool. See the - [computer use guide](/docs/guides/tools-computer-use) for more information. + - `ContainerAuto object { type, file_ids, memory_limit, 2 more }` - - `id: string` + - `LocalEnvironment object { type, skills }` - The unique ID of the computer call. + - `ContainerReference object { container_id, type }` - - `call_id: string` + - `Custom object { name, type, defer_loading, 2 more }` - An identifier used when responding to the tool call with output. + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `pending_safety_checks: array of object { id, code, message }` + - `name: string` - The pending safety checks for the computer call. + The name of the custom tool, used to identify it in tool calls. - - `id: string` + - `type: "custom"` - The ID of the pending safety check. + The type of the custom tool. Always `custom`. - - `code: optional string` + - `"custom"` - The type of the pending safety check. + - `defer_loading: optional boolean` - - `message: optional string` + Whether this tool should be deferred and discovered via tool search. - Details about the pending safety check. + - `description: optional string` - - `status: "in_progress" or "completed" or "incomplete"` + Optional description of the custom tool, used to provide more context. - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `format: optional CustomToolInputFormat` - - `"in_progress"` + The input format for the custom tool. Default is unconstrained text. - - `"completed"` + - `Namespace object { description, name, tools, type }` - - `"incomplete"` + Groups function/custom tools under a shared namespace. - - `type: "computer_call"` + - `description: string` - The type of the computer call. Always `computer_call`. + A description of the namespace shown to the model. - - `"computer_call"` + - `name: string` - - `action: optional ComputerAction` + The namespace name used in tool calls (for example, `crm`). - A click action. + - `tools: array of object { name, type, defer_loading, 3 more } or object { name, type, defer_loading, 2 more }` - - `actions: optional ComputerActionList` + The function/custom tools available inside this namespace. - Flattened batched actions for `computer_use`. Each action includes an - `type` discriminator and action-specific fields. + - `Function object { name, type, defer_loading, 3 more }` - - `ComputerCallOutput object { id, call_id, output, 4 more }` + - `name: string` - - `id: string` + - `type: "function"` - The unique ID of the computer call tool output. + - `"function"` - - `call_id: string` + - `defer_loading: optional boolean` - The ID of the computer tool call that produced the output. + Whether this function should be deferred and discovered via tool search. - - `output: ResponseComputerToolCallOutputScreenshot` + - `description: optional string` - A computer screenshot image used with the computer use tool. + - `parameters: optional unknown` - - `status: "completed" or "incomplete" or "failed" or "in_progress"` + - `strict: optional boolean` - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. + - `Custom object { name, type, defer_loading, 2 more }` - - `"completed"` + A custom tool that processes input using a specified format. Learn more about [custom tools](/docs/guides/function-calling#custom-tools) - - `"incomplete"` + - `name: string` - - `"failed"` + The name of the custom tool, used to identify it in tool calls. - - `"in_progress"` + - `type: "custom"` - - `type: "computer_call_output"` + The type of the custom tool. Always `custom`. - The type of the computer tool call output. Always `computer_call_output`. + - `"custom"` - - `"computer_call_output"` + - `defer_loading: optional boolean` - - `acknowledged_safety_checks: optional array of object { id, code, message }` + Whether this tool should be deferred and discovered via tool search. - The safety checks reported by the API that have been acknowledged by the - developer. + - `description: optional string` - - `id: string` + Optional description of the custom tool, used to provide more context. - The ID of the pending safety check. + - `format: optional CustomToolInputFormat` - - `code: optional string` + The input format for the custom tool. Default is unconstrained text. - The type of the pending safety check. + - `type: "namespace"` - - `message: optional string` + The type of the tool. Always `namespace`. - Details about the pending safety check. + - `"namespace"` - - `created_by: optional string` + - `ToolSearch object { type, description, execution, parameters }` - The identifier of the actor that created the item. + Hosted or BYOT tool search configuration for deferred tools. - - `Reasoning object { id, summary, type, 3 more }` + - `type: "tool_search"` - 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](/docs/guides/conversation-state). + The type of the tool. Always `tool_search`. - - `id: string` + - `"tool_search"` - The unique identifier of the reasoning content. + - `description: optional string` - - `summary: array of SummaryTextContent` + Description shown to the model for a client-executed tool search tool. - Reasoning summary content. + - `execution: optional "server" or "client"` - - `text: string` + Whether tool search is executed by the server or by the client. - A summary of the reasoning output from the model so far. + - `"server"` - - `type: "summary_text"` + - `"client"` - The type of the object. Always `summary_text`. + - `parameters: optional unknown` - - `type: "reasoning"` + Parameter schema for a client-executed tool search tool. - The type of the object. Always `reasoning`. + - `WebSearchPreview object { type, search_content_types, search_context_size, user_location }` - - `"reasoning"` + This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). - - `content: optional array of object { text, type }` + - `type: "web_search_preview" or "web_search_preview_2025_03_11"` - Reasoning text content. + The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - - `text: string` + - `"web_search_preview"` - The reasoning text from the model. + - `"web_search_preview_2025_03_11"` - - `type: "reasoning_text"` + - `search_content_types: optional array of "text" or "image"` - The type of the reasoning text. Always `reasoning_text`. + - `"text"` - - `"reasoning_text"` + - `"image"` - - `encrypted_content: optional string` + - `search_context_size: optional "low" or "medium" or "high"` - The encrypted content of the reasoning item - populated when a response is - generated with `reasoning.encrypted_content` in the `include` parameter. + 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. - - `status: optional "in_progress" or "completed" or "incomplete"` + - `"low"` - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. + - `"medium"` - - `"in_progress"` + - `"high"` - - `"completed"` + - `user_location: optional object { type, city, country, 2 more }` - - `"incomplete"` + The user's location. - - `ToolSearchCall object { id, arguments, call_id, 4 more }` + - `type: "approximate"` - - `id: string` + The type of location approximation. Always `approximate`. - The unique ID of the tool search call item. + - `"approximate"` - - `arguments: unknown` + - `city: optional string` - Arguments used for the tool search call. + Free text input for the city of the user, e.g. `San Francisco`. - - `call_id: string` + - `country: optional string` - The unique ID of the tool search call generated by the model. + The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`. - - `execution: "server" or "client"` + - `region: optional string` - Whether tool search was executed by the server or by the client. + Free text input for the region of the user, e.g. `California`. - - `"server"` + - `timezone: optional string` - - `"client"` + The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`. - - `status: "in_progress" or "completed" or "incomplete"` + - `ApplyPatch object { type }` - The status of the tool search call item that was recorded. + Allows the assistant to create, delete, or update files using unified diffs. - - `"in_progress"` + - `type: "apply_patch"` - - `"completed"` + The type of the tool. Always `apply_patch`. - - `"incomplete"` + - `"apply_patch"` - - `type: "tool_search_call"` + - `type: "tool_search_output"` - The type of the item. Always `tool_search_call`. + The type of the item. Always `tool_search_output`. - - `"tool_search_call"` + - `"tool_search_output"` - `created_by: optional string` The identifier of the actor that created the item. - - `ToolSearchOutput object { id, call_id, execution, 4 more }` + - `AdditionalTools object { id, role, tools, type }` - `id: string` - The unique ID of the tool search output item. - - - `call_id: string` + The unique ID of the additional tools item. - The unique ID of the tool search call generated by the model. + - `role: "unknown" or "user" or "assistant" or 5 more` - - `execution: "server" or "client"` + The role that provided the additional tools. - Whether tool search was executed by the server or by the client. + - `"unknown"` - - `"server"` + - `"user"` - - `"client"` + - `"assistant"` - - `status: "in_progress" or "completed" or "incomplete"` + - `"system"` - The status of the tool search output item that was recorded. + - `"critic"` - - `"in_progress"` + - `"discriminator"` - - `"completed"` + - `"developer"` - - `"incomplete"` + - `"tool"` - `tools: array of object { name, parameters, strict, 3 more } or object { type, vector_store_ids, filters, 2 more } or object { type } or 12 more` - The loaded tool definitions returned by tool search. + The additional tool definitions made available at this item. - `Function object { name, parameters, strict, 3 more }` @@ -8694,15 +10950,11 @@ as input for the model's response. - `"apply_patch"` - - `type: "tool_search_output"` - - The type of the item. Always `tool_search_output`. - - - `"tool_search_output"` + - `type: "additional_tools"` - - `created_by: optional string` + The type of the item. Always `additional_tools`. - The identifier of the actor that created the item. + - `"additional_tools"` - `Compaction object { id, encrypted_content, type, created_by }` @@ -10414,6 +12666,12 @@ as input for the model's response. - `prompt_cache_retention: optional "in_memory" or "24h"` The retention policy for the prompt cache. Set to `24h` to enable extended prompt caching, which keeps cached prefixes active for longer, up to a maximum of 24 hours. [Learn more](/docs/guides/prompt-caching#prompt-cache-retention). + For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported. + + For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy: + + - Organizations without ZDR enabled default to `24h`. + - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified. - `"in_memory"`