---
title: "Get a model response"
method: GET
path: "/responses/{response_id}?beta=true"
tags: ["Responses"]
---

# Get a model response

`GET /responses/{response_id}?beta=true`

Retrieves a model response with the given ID.

## Path parameters

- `response_id` string, required

## Query parameters

- `include` BetaIncludeEnum[]
- `stream` boolean
- `starting_after` integer
- `include_obfuscation` boolean

## Headers

- `openai-beta` string[]

## Response `200`

OK

- BetaResponse
  - `metadata` BetaMetadata, nullable, required — 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.
  - `top_logprobs` integer, nullable — 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.
  - `temperature` number, nullable, required — 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.
  - `top_p` number, nullable, required — 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.
  - `user` 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](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
  - `safety_identifier` string, nullable — 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](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
  - `prompt_cache_key` string, nullable — Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast', nullable — 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](https://platform.openai.com/docs/guides/flex-processing)', then the request will be processed with the Flex Processing service tier. - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level, include the `service_tier=fast` or `service_tier=priority` parameter for Responses or Chat Completions. The response will show `service_tier=priority` regardless of if you specify `service_tier=fast` or `priority` in your request. - 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.
  - `prompt_cache_retention` 'in_memory' | '24h', nullable — Deprecated. Use `prompt_cache_options.ttl` instead. 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](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention). This field expresses a maximum retention policy, while `prompt_cache_options.ttl` expresses a minimum cache lifetime. The two fields are independent and do not interact. 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.
  - `previous_response_id` string, nullable — The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.
  - `model` union, required
    - union
      - string
      - 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | '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'
    - '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'
  - `background` boolean, nullable — Whether to run the model response in the background. [Learn more](https://platform.openai.com/docs/guides/background).
  - `max_tool_calls` integer, nullable — 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` BetaResponseTextParam — Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)
    - `format` union — 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](https://platform.openai.com/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.
      - BetaResponseFormatText — Default response format. Used to generate text responses.
        - `type` 'text', required — The type of response format being defined. Always `text`.
      - BetaTextResponseFormatJsonSchema — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
        - `type` 'json_schema', required — The type of response format being defined. Always `json_schema`.
        - `description` string — A description of what the response format is for, used by the model to determine how to respond in the format.
        - `name` string, required — 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` BetaResponseFormatJsonSchemaSchema, required — The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas [here](https://json-schema.org/).
        - `strict` boolean, nullable — 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](https://platform.openai.com/docs/guides/structured-outputs).
      - BetaResponseFormatJsonObject — 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', required — The type of response format being defined. Always `json_object`.
    - `verbosity` 'low' | 'medium' | 'high', nullable — 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 default is `medium`.
  - `tools` BetaTool[], required — 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](https://platform.openai.com/docs/guides/tools-web-search) or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about [built-in tools](https://platform.openai.com/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](https://platform.openai.com/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](https://platform.openai.com/docs/guides/function-calling). You can also use custom tools to call your own code.
    - union — A tool that can be used to generate a response.
      - BetaFunctionTool — 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).
        - `type` 'function', required — The type of the function tool. Always `function`.
        - `name` string, required — The name of the function to call.
        - `description` string, nullable — A description of the function. Used by the model to determine whether or not to call the function.
        - `parameters` object, nullable, required — A JSON schema object describing the parameters of the function.
        - `output_schema` object, nullable — A JSON schema object describing the JSON value encoded in string outputs for this function.
        - `strict` boolean, nullable, required — Whether strict parameter validation is enforced for this function tool.
        - `defer_loading` boolean — Whether this function is deferred and loaded via tool search.
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
      - BetaFileSearchTool — 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', required — The type of the file search tool. Always `file_search`.
        - `vector_store_ids` string[], required — The IDs of the vector stores to search.
        - `max_num_results` integer — The maximum number of results to return. This number should be between 1 and 50 inclusive.
        - `ranking_options` BetaRankingOptions
          - `ranker` 'auto' | 'default-2024-11-15'
          - `score_threshold` number — The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results.
          - `hybrid_search` BetaHybridSearchOptions
            - `embedding_weight` number, required — The weight of the embedding in the reciprocal ranking fusion.
            - `text_weight` number, required — The weight of the text in the reciprocal ranking fusion.
        - `filters` union
          - BetaComparisonFilter — A filter used to compare a specified attribute key to a given value using a defined comparison operation.
            - `type` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin', required — Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - `eq`: equals - `ne`: not equal - `gt`: greater than - `gte`: greater than or equal - `lt`: less than - `lte`: less than or equal - `in`: in - `nin`: not in
            - `key` string, required — The key to compare against the value.
            - `value` union, required — The value to compare against the attribute key; supports string, number, or boolean types.
              - …
          - BetaCompoundFilter — Combine multiple filters using `and` or `or`.
            - `type` 'and' | 'or', required — Type of operation: `and` or `or`.
            - `filters` union[], required — Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
              - …
      - BetaComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer', required — The type of the computer tool. Always `computer`.
      - BetaComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
        - `type` 'computer_use_preview', required — The type of the computer use tool. Always `computer_use_preview`.
        - `environment` 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser', required
        - `display_width` integer, required — The width of the computer display.
        - `display_height` integer, required — The height of the computer display.
      - BetaWebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
        - `type` 'web_search' | 'web_search_2025_08_26', required — The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
        - `filters` object, nullable — Filters for the search.
          - `allowed_domains` string[], nullable — 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"]`
        - `user_location` BetaWebSearchApproximateLocation, nullable — The approximate location of the user.
          - `type` 'approximate' — The type of location approximation. Always `approximate`.
          - `country` string, nullable — The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
          - `region` string, nullable — Free text input for the region of the user, e.g. `California`.
          - `city` string, nullable — Free text input for the city of the user, e.g. `San Francisco`.
          - `timezone` string, nullable — The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
        - `search_context_size` 'low' | 'medium' | 'high' — High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
      - BetaMCPTool — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
        - `type` 'mcp', required — The type of the MCP tool. Always `mcp`.
        - `server_label` string, required — A label for this MCP server, used to identify it in tool calls.
        - `server_url` string, uri — The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id` must be provided.
        - `connector_id` 'connector_dropbox' | 'connector_gmail' | 'connector_googlecalendar' | 'connector_googledrive' | 'connector_microsoftteams' | 'connector_outlookcalendar' | 'connector_outlookemail' | 'connector_sharepoint' — Identifier for service connectors, like those available in ChatGPT. One of `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about service connectors [here](https://platform.openai.com/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`
        - `tunnel_id` string — The Secure MCP Tunnel ID to use instead of a direct server URL. One of `server_url`, `connector_id`, or `tunnel_id` must be provided.
        - `authorization` string — An OAuth access token that can be used with a remote MCP server, either with a custom MCP server URL or a service connector. Your application must handle the OAuth authorization flow and provide the token here.
        - `server_description` string — Optional description of the MCP server, used to provide more context.
        - `headers` object, nullable — Optional HTTP headers to send to the MCP server. Use for authentication or other purposes.
        - `allowed_tools` union
          - string[] — A string array of allowed tool names
          - BetaMCPToolFilter — A filter object to specify which tools are allowed.
            - `tool_names` string[] — List of allowed tool names.
            - `read_only` 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.
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
        - `require_approval` union
          - object — 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` BetaMCPToolFilter — A filter object to specify which tools are allowed.
              - …
            - `never` BetaMCPToolFilter — A filter object to specify which tools are allowed.
              - …
          - 'always' | '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.
        - `defer_loading` boolean — Whether this MCP tool is deferred and discovered via tool search.
      - BetaCodeInterpreterTool — A tool that runs Python code to help generate a response to a prompt.
        - `type` 'code_interpreter', required — The type of the code interpreter tool. Always `code_interpreter`.
        - `container` union, required — 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.
          - BetaAutoCodeInterpreterToolParam — Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
            - `type` 'auto', required — Always `auto`.
            - `file_ids` string[] — An optional list of uploaded files to make available to your code.
            - `memory_limit` '1g' | '4g' | '16g' | '64g'
            - `network_policy` union — Network access policy for the container.
              - …
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
      - BetaProgrammaticToolCallingParam
        - `type` 'programmatic_tool_calling', required — The type of the tool. Always `programmatic_tool_calling`.
      - BetaImageGenTool — A tool that generates images using the GPT image models.
        - `type` 'image_generation', required — The type of the image generation tool. Always `image_generation`.
        - `model` union
          - string
          - 'gpt-image-1' | 'gpt-image-1-mini' | 'gpt-image-2' | 'gpt-image-2-2026-04-21' | 'gpt-image-1.5' | 'chatgpt-image-latest' — The image generation model to use. Default: `gpt-image-1`.
        - `quality` 'low' | 'medium' | 'high' | 'auto' — The quality of the generated image. One of `low`, `medium`, `high`, or `auto`. Default: `auto`.
        - `size` union — 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' | '1024x1536' | '1536x1024' | 'auto'
        - `output_format` 'png' | 'webp' | 'jpeg' — The output format of the generated image. One of `png`, `webp`, or `jpeg`. Default: `png`.
        - `output_compression` integer — Compression level for the output image. Default: 100.
        - `moderation` 'auto' | 'low' — Moderation level for the generated image. Default: `auto`.
        - `background` 'transparent' | 'opaque' | 'auto' — Allows to set transparency for the background of the generated image(s). This parameter is only supported for GPT image models that support transparent backgrounds. Must be one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used, the model will automatically determine the best background for the image. `gpt-image-2` and `gpt-image-2-2026-04-21` do not support transparent backgrounds. Requests with `background` set to `transparent` will return an error for these models; use `opaque` or `auto` instead. If `transparent`, the output format needs to support transparency, so it should be set to either `png` (default value) or `webp`.
        - `input_fidelity` 'high' | '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`.
        - `input_image_mask` object — Optional mask for inpainting. Contains `image_url` (string, optional) and `file_id` (string, optional).
          - `image_url` string — Base64-encoded mask image.
          - `file_id` string — File ID for the mask image.
        - `partial_images` integer — Number of partial images to generate in streaming mode, from 0 (default value) to 3.
        - `action` 'generate' | 'edit' | 'auto'
      - BetaLocalShellToolParam — A tool that allows the model to execute shell commands in a local environment.
        - `type` 'local_shell', required — The type of the local shell tool. Always `local_shell`.
      - BetaFunctionShellToolParam — A tool that allows the model to execute shell commands.
        - `type` 'shell', required — The type of the shell tool. Always `shell`.
        - `environment` union
          - BetaContainerAutoParam
            - `type` 'container_auto', required — Automatically creates a container for this request
            - `file_ids` string[] — An optional list of uploaded files to make available to your code.
            - `memory_limit` '1g' | '4g' | '16g' | '64g'
            - `network_policy` union — Network access policy for the container.
              - …
            - `skills` union[] — An optional list of skills referenced by id or inline data.
              - …
          - BetaLocalEnvironmentParam
            - `type` 'local', required — Use a local computer environment.
            - `skills` BetaLocalSkillParam[] — An optional list of skills.
              - …
          - BetaContainerReferenceParam
            - `type` 'container_reference', required — References a container created with the /v1/containers endpoint
            - `container_id` string, required — The ID of the referenced container.
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
      - BetaCustomToolParam — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
        - `type` 'custom', required — The type of the custom tool. Always `custom`.
        - `name` string, required — The name of the custom tool, used to identify it in tool calls.
        - `description` string — Optional description of the custom tool, used to provide more context.
        - `format` union — The input format for the custom tool. Default is unconstrained text.
          - BetaCustomTextFormatParam — Unconstrained free-form text.
            - `type` 'text', required — Unconstrained text format. Always `text`.
          - BetaCustomGrammarFormatParam — A grammar defined by the user.
            - `type` 'grammar', required — Grammar format. Always `grammar`.
            - `syntax` 'lark' | 'regex', required
            - `definition` string, required — The grammar definition.
        - `defer_loading` boolean — Whether this tool should be deferred and discovered via tool search.
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
      - BetaNamespaceToolParam — Groups function/custom tools under a shared namespace.
        - `type` 'namespace', required — The type of the tool. Always `namespace`.
        - `name` string, required — The namespace name used in tool calls (for example, `crm`).
        - `description` string, required — A description of the namespace shown to the model.
        - `tools` union[], required — The function/custom tools available inside this namespace.
          - union — A function or custom tool that belongs to a namespace.
            - BetaFunctionToolParam
              - …
            - BetaCustomToolParam — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
      - BetaToolSearchToolParam — Hosted or BYOT tool search configuration for deferred tools.
        - `type` 'tool_search', required — The type of the tool. Always `tool_search`.
        - `execution` 'server' | 'client'
        - `description` string, nullable — Description shown to the model for a client-executed tool search tool.
        - `parameters` BetaEmptyModelParam
      - BetaWebSearchPreviewTool — 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' | 'web_search_preview_2025_03_11', required — The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.
        - `user_location` BetaApproximateLocation
          - `type` 'approximate', required — The type of location approximation. Always `approximate`.
          - `country` string, nullable — The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
          - `region` string, nullable — Free text input for the region of the user, e.g. `California`.
          - `city` string, nullable — Free text input for the city of the user, e.g. `San Francisco`.
          - `timezone` string, nullable — The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
        - `search_context_size` 'low' | 'medium' | 'high'
        - `search_content_types` BetaSearchContentType[]
      - BetaApplyPatchToolParam — Allows the assistant to create, delete, or update files using unified diffs.
        - `type` 'apply_patch', required — The type of the tool. Always `apply_patch`.
        - `allowed_callers` BetaCallableToolAllowedCaller[], nullable — The tool invocation context(s).
  - `tool_choice` union, required — 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.
    - 'none' | 'auto' | '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.
    - BetaToolChoiceAllowed — Constrains the tools available to the model to a pre-defined set.
      - `type` 'allowed_tools', required — Allowed tool configuration type. Always `allowed_tools`.
      - `mode` 'auto' | 'required', 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.
      - `tools` object[], required — 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" } ] ```
    - BetaToolChoiceTypes — Indicates that the model should use a built-in tool to generate a response. [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools).
      - `type` 'file_search' | 'web_search_preview' | 'computer' | 'computer_use_preview' | 'computer_use' | 'web_search_preview_2025_03_11' | 'image_generation' | 'code_interpreter', required — The type of hosted tool the model should to use. Learn more about [built-in tools](https://platform.openai.com/docs/guides/tools). Allowed values are: - `file_search` - `web_search_preview` - `computer` - `computer_use_preview` - `computer_use` - `code_interpreter` - `image_generation`
    - BetaToolChoiceFunction — Use this option to force the model to call a specific function.
      - `type` 'function', required — For function calling, the type is always `function`.
      - `name` string, required — The name of the function to call.
    - BetaToolChoiceMCP — Use this option to force the model to call a specific tool on a remote MCP server.
      - `type` 'mcp', required — For MCP tools, the type is always `mcp`.
      - `server_label` string, required — The label of the MCP server to use.
      - `name` string, nullable — The name of the tool to call on the server.
    - BetaToolChoiceCustom — Use this option to force the model to call a specific custom tool.
      - `type` 'custom', required — For custom tool calling, the type is always `custom`.
      - `name` string, required — The name of the custom tool to call.
    - BetaSpecificProgrammaticToolCallingParam
      - `type` 'programmatic_tool_calling', required — The tool to call. Always `programmatic_tool_calling`.
    - BetaSpecificApplyPatchParam — Forces the model to call the apply_patch tool when executing a tool call.
      - `type` 'apply_patch', required — The tool to call. Always `apply_patch`.
    - BetaSpecificFunctionShellParam — Forces the model to call the shell tool when a tool call is required.
      - `type` 'shell', required — The tool to call. Always `shell`.
  - `prompt` BetaPrompt, nullable — Reference to a prompt template and its variables. [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
    - `id` string, required — The unique identifier of the prompt template to use.
    - `version` string, nullable — Optional version of the prompt template.
    - `variables` BetaResponsePromptVariables, nullable — 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.
  - `truncation` 'auto' | 'disabled', nullable — 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.
  - `id` string, required — Unique identifier for this Response.
  - `object` 'response', required — The object type of this resource - always set to `response`.
  - `status` 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete' — The status of the response generation. One of `completed`, `failed`, `in_progress`, `cancelled`, `queued`, or `incomplete`.
  - `created_at` number, required — Unix timestamp (in seconds) of when this Response was created.
  - `completed_at` number, nullable — Unix timestamp (in seconds) of when this Response was completed. Only present when the status is `completed`.
  - `error` BetaResponseError, nullable, required — An error object returned when the model fails to generate a Response.
    - `code` 'server_error' | 'rate_limit_exceeded' | 'invalid_prompt' | 'data_residency_mismatch' | 'bio_policy' | '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', required — The error code for the response.
    - `message` string, required — A human-readable description of the error.
  - `incomplete_details` object, nullable, required — Details about why the response is incomplete.
    - `reason` 'max_output_tokens' | 'content_filter' — The reason why the response is incomplete.
  - `output` BetaOutputItem[], required — An array of content items generated by the model. - 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.
    - union
      - BetaOutputMessage — An output message from the model.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `id` string, required — The unique ID of the output message.
        - `type` 'message', required — The type of the output message. Always `message`.
        - `role` 'assistant', required — The role of the output message. Always `assistant`.
        - `content` BetaOutputMessageContent[], required — The content of the output message.
          - union
            - BetaOutputTextContent — A text output from the model.
              - …
            - BetaRefusalContent — A refusal from the model.
              - …
        - `phase` 'commentary' | '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.
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
      - BetaFileSearchToolCall — The results of a file search tool call. See the [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `id` string, required — The unique ID of the file search tool call.
        - `type` 'file_search_call', required — The type of the file search tool call. Always `file_search_call`.
        - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required — The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,
        - `queries` string[], required — The queries used to search for files.
        - `results` object[], nullable — The results of the file search tool call.
          - `file_id` string — The unique ID of the file.
          - `text` string — The text that was retrieved from the file.
          - `filename` string — The name of the file.
          - `attributes` BetaVectorStoreFileAttributes, nullable — 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.
          - `score` number, float — The relevance score of the file - a value between 0 and 1.
      - BetaFunctionToolCall — A tool call to run a function. See the [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `id` string — The unique ID of the function tool call.
        - `type` 'function_call', required — The type of the function tool call. Always `function_call`.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `namespace` string — The namespace of the function to run.
        - `name` string, required — The name of the function to run.
        - `arguments` string, required — A JSON string of the arguments to pass to the function.
        - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - BetaFunctionToolCallOutputResource — The output of a function tool call.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `id` string, required — The unique ID of the function call tool output.
        - `type` 'function_call_output', required — The type of the function tool call output. Always `function_call_output`.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCallerParam
            - `type` 'direct', required — The caller type. Always `direct`.
          - BetaProgramToolCallCallerParam
            - `type` 'program', required — The caller type. Always `program`.
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `output` union, required — The output from the function call generated by your code. Can be a string or an list of output content.
          - string — A string of the output of the function call.
          - BetaFunctionAndCustomToolCallOutput[] — Text, image, or file output of the function call.
            - union
              - …
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
        - `created_by` string — The identifier of the actor that created the item.
      - BetaAgentMessage
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'agent_message', required — The type of the item. Always `agent_message`.
        - `id` string, required — The unique ID of the agent message.
        - `author` string, required — The sending agent identity.
        - `recipient` string, required — The destination agent identity.
        - `content` union[], required — Encrypted content sent between agents.
          - union — A content part that makes up an input or output item.
            - BetaInputTextContent — A text input to the model.
              - …
            - BetaOutputTextContent — A text output from the model.
              - …
            - BetaTextContent — A text content.
              - …
            - BetaSummaryTextContent — A summary text from the model.
              - …
            - BetaReasoningTextContent — Reasoning text from the model.
              - …
            - BetaRefusalContent — A refusal from the model.
              - …
            - BetaInputImageContent — An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
              - …
            - BetaComputerScreenshotContent — A screenshot of a computer.
              - …
            - BetaInputFileContent — A file input to the model.
              - …
            - BetaEncryptedContent — Opaque encrypted content that Responses API decrypts inside trusted model execution.
              - …
      - BetaMultiAgentCall
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'multi_agent_call', required — The type of the multi-agent call. Always `multi_agent_call`.
        - `id` string, required — The unique ID of the multi-agent call item.
        - `call_id` string, required — The unique ID linking this call to its output.
        - `action` 'spawn_agent' | 'interrupt_agent' | 'list_agents' | 'send_message' | 'followup_task' | 'wait_agent', required
        - `arguments` string, required — The JSON string of arguments generated for the action.
      - BetaMultiAgentCallOutput
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'multi_agent_call_output', required — The type of the multi-agent result. Always `multi_agent_call_output`.
        - `id` string, required — The unique ID of the multi-agent call output item.
        - `call_id` string, required — The unique ID of the multi-agent call.
        - `action` 'spawn_agent' | 'interrupt_agent' | 'list_agents' | 'send_message' | 'followup_task' | 'wait_agent', required
        - `output` BetaOutputTextContent[], required — Text output returned by the multi-agent action.
          - `type` 'output_text', required — The type of the output text. Always `output_text`.
          - `text` string, required — The text output from the model.
          - `annotations` BetaAnnotation[], required — The annotations of the text output.
            - union — An annotation that applies to a span of output text.
              - …
          - `logprobs` BetaLogProb[]
            - `token` string, required
            - `logprob` number, required
            - `bytes` integer[], required
            - `top_logprobs` BetaTopLogProb[], required
              - …
      - BetaWebSearchToolCall — The results of a web search tool call. See the [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `id` string, required — The unique ID of the web search tool call.
        - `type` 'web_search_call', required — The type of the web search tool call. Always `web_search_call`.
        - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required — The status of the web search tool call.
        - `action` union, required — 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).
          - object — Action type "search" - Performs a web search query.
            - `type` 'search', required — The action type.
            - `query` string — The search query.
            - `queries` string[] — The search queries.
            - `sources` object[] — The sources used in the search.
              - …
          - object — Action type "open_page" - Opens a specific URL from search results.
            - `type` 'open_page', required — The action type.
            - `url` string, uri, nullable — The URL opened by the model.
          - object — Action type "find_in_page": Searches for a pattern within a loaded page.
            - `type` 'find_in_page', required — The action type.
            - `url` string, uri, required — The URL of the page searched for the pattern.
            - `pattern` string, required — The pattern or text to search for within the page.
      - BetaComputerToolCall — A tool call to a computer use tool. See the [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'computer_call', required — The type of the computer call. Always `computer_call`.
        - `id` string, required — The unique ID of the computer call.
        - `call_id` string, required — An identifier used when responding to the tool call with output.
        - `action` union
          - BetaClickParam — A click action.
            - `type` 'click', required — Specifies the event type. For a click action, this property is always `click`.
            - `button` 'left' | 'right' | 'wheel' | 'back' | 'forward', required
            - `x` integer, required — The x-coordinate where the click occurred.
            - `y` integer, required — The y-coordinate where the click occurred.
            - `keys` string[], nullable — The keys being held while clicking.
          - BetaDoubleClickAction — A double click action.
            - `type` 'double_click', required — Specifies the event type. For a double click action, this property is always set to `double_click`.
            - `x` integer, required — The x-coordinate where the double click occurred.
            - `y` integer, required — The y-coordinate where the double click occurred.
            - `keys` string[], nullable, required — The keys being held while double-clicking.
          - BetaDragParam — A drag action.
            - `type` 'drag', required — Specifies the event type. For a drag action, this property is always set to `drag`.
            - `path` BetaCoordParam[], required — An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg ``` [ { x: 100, y: 200 }, { x: 200, y: 300 } ] ```
              - …
            - `keys` string[], nullable — The keys being held while dragging the mouse.
          - BetaKeyPressAction — A collection of keypresses the model would like to perform.
            - `type` 'keypress', required — Specifies the event type. For a keypress action, this property is always set to `keypress`.
            - `keys` string[], required — The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.
          - BetaMoveParam — A mouse move action.
            - `type` 'move', required — Specifies the event type. For a move action, this property is always set to `move`.
            - `x` integer, required — The x-coordinate to move to.
            - `y` integer, required — The y-coordinate to move to.
            - `keys` string[], nullable — The keys being held while moving the mouse.
          - BetaScreenshotParam — A screenshot action.
            - `type` 'screenshot', required — Specifies the event type. For a screenshot action, this property is always set to `screenshot`.
          - BetaScrollParam — A scroll action.
            - `type` 'scroll', required — Specifies the event type. For a scroll action, this property is always set to `scroll`.
            - `x` integer, required — The x-coordinate where the scroll occurred.
            - `y` integer, required — The y-coordinate where the scroll occurred.
            - `scroll_x` integer, required — The horizontal scroll distance.
            - `scroll_y` integer, required — The vertical scroll distance.
            - `keys` string[], nullable — The keys being held while scrolling.
          - BetaTypeParam — An action to type in text.
            - `type` 'type', required — Specifies the event type. For a type action, this property is always set to `type`.
            - `text` string, required — The text to type.
          - BetaWaitParam — A wait action.
            - `type` 'wait', required — Specifies the event type. For a wait action, this property is always set to `wait`.
        - `actions` BetaComputerAction[] — Flattened batched actions for `computer_use`. Each action includes an `type` discriminator and action-specific fields.
          - union
            - BetaClickParam — A click action.
              - …
            - BetaDoubleClickAction — A double click action.
              - …
            - BetaDragParam — A drag action.
              - …
            - BetaKeyPressAction — A collection of keypresses the model would like to perform.
              - …
            - BetaMoveParam — A mouse move action.
              - …
            - BetaScreenshotParam — A screenshot action.
              - …
            - BetaScrollParam — A scroll action.
              - …
            - BetaTypeParam — An action to type in text.
              - …
            - BetaWaitParam — A wait action.
              - …
        - `pending_safety_checks` BetaComputerCallSafetyCheckParam[], required — The pending safety checks for the computer call.
          - `id` string, required — The ID of the pending safety check.
          - `code` string, nullable — The type of the pending safety check.
          - `message` string, nullable — Details about the pending safety check.
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - BetaComputerToolCallOutputResource — The output of a computer tool call.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'computer_call_output', required — The type of the computer tool call output. Always `computer_call_output`.
        - `id` string, required — The unique ID of the computer call tool output.
        - `call_id` string, required — The ID of the computer tool call that produced the output.
        - `acknowledged_safety_checks` BetaComputerCallSafetyCheckParam[] — The safety checks reported by the API that have been acknowledged by the developer.
          - `id` string, required — The ID of the pending safety check.
          - `code` string, nullable — The type of the pending safety check.
          - `message` string, nullable — Details about the pending safety check.
        - `output` BetaComputerScreenshotImage, required — A computer screenshot image used with the computer use tool.
          - `type` 'computer_screenshot', required — Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.
          - `image_url` string, uri — The URL of the screenshot image.
          - `file_id` string — The identifier of an uploaded file that contains the screenshot.
        - `status` 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
        - `created_by` string — The identifier of the actor that created the item.
      - BetaReasoningItem — 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](https://platform.openai.com/docs/guides/conversation-state).
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'reasoning', required — The type of the object. Always `reasoning`.
        - `id` string, required — The unique identifier of the reasoning content.
        - `encrypted_content` string, nullable — The encrypted content of the reasoning item. This is populated by default for reasoning items returned by `POST /v1/responses` and WebSocket `response.create` requests.
        - `summary` BetaSummaryTextContent[], required — Reasoning summary content.
          - `type` 'summary_text', required — The type of the object. Always `summary_text`.
          - `text` string, required — A summary of the reasoning output from the model so far.
        - `content` BetaReasoningTextContent[] — Reasoning text content.
          - `type` 'reasoning_text', required — The type of the reasoning text. Always `reasoning_text`.
          - `text` string, required — The reasoning text from the model.
        - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
      - BetaProgram
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'program', required — The type of the item. Always `program`.
        - `id` string, required — The unique ID of the program item.
        - `call_id` string, required — The stable call ID of the program item.
        - `code` string, required — The JavaScript source executed by programmatic tool calling.
        - `fingerprint` string, required — Opaque program replay fingerprint that must be round-tripped.
      - BetaProgramOutput
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'program_output', required — The type of the item. Always `program_output`.
        - `id` string, required — The unique ID of the program output item.
        - `call_id` string, required — The call ID of the program item.
        - `result` string, required — The result produced by the program item.
        - `status` 'completed' | 'incomplete', required
      - BetaToolSearchCall
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'tool_search_call', required — The type of the item. Always `tool_search_call`.
        - `id` string, required — The unique ID of the tool search call item.
        - `call_id` string, nullable, required — The unique ID of the tool search call generated by the model.
        - `execution` 'server' | 'client', required
        - `arguments` unknown, required
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `created_by` string — The identifier of the actor that created the item.
      - BetaToolSearchOutput
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'tool_search_output', required — The type of the item. Always `tool_search_output`.
        - `id` string, required — The unique ID of the tool search output item.
        - `call_id` string, nullable, required — The unique ID of the tool search call generated by the model.
        - `execution` 'server' | 'client', required
        - `tools` BetaTool[], required — The loaded tool definitions returned by tool search.
          - union — A tool that can be used to generate a response.
            - BetaFunctionTool — 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).
              - …
            - BetaFileSearchTool — 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).
              - …
            - BetaComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - BetaComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - BetaWebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - BetaMCPTool — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
              - …
            - BetaCodeInterpreterTool — A tool that runs Python code to help generate a response to a prompt.
              - …
            - BetaProgrammaticToolCallingParam
              - …
            - BetaImageGenTool — A tool that generates images using the GPT image models.
              - …
            - BetaLocalShellToolParam — A tool that allows the model to execute shell commands in a local environment.
              - …
            - BetaFunctionShellToolParam — A tool that allows the model to execute shell commands.
              - …
            - BetaCustomToolParam — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
            - BetaNamespaceToolParam — Groups function/custom tools under a shared namespace.
              - …
            - BetaToolSearchToolParam — Hosted or BYOT tool search configuration for deferred tools.
              - …
            - BetaWebSearchPreviewTool — 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).
              - …
            - BetaApplyPatchToolParam — Allows the assistant to create, delete, or update files using unified diffs.
              - …
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `created_by` string — The identifier of the actor that created the item.
      - BetaAdditionalTools
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'additional_tools', required — The type of the item. Always `additional_tools`.
        - `id` string, required — The unique ID of the additional tools item.
        - `role` 'unknown' | 'user' | 'assistant' | 'system' | 'critic' | 'discriminator' | 'developer' | 'tool', required
        - `tools` BetaTool[], required — The additional tool definitions made available at this item.
          - union — A tool that can be used to generate a response.
            - BetaFunctionTool — 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).
              - …
            - BetaFileSearchTool — 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).
              - …
            - BetaComputerTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - BetaComputerUsePreviewTool — A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).
              - …
            - BetaWebSearchTool — Search the Internet for sources related to the prompt. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
              - …
            - BetaMCPTool — Give the model access to additional tools via remote Model Context Protocol (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
              - …
            - BetaCodeInterpreterTool — A tool that runs Python code to help generate a response to a prompt.
              - …
            - BetaProgrammaticToolCallingParam
              - …
            - BetaImageGenTool — A tool that generates images using the GPT image models.
              - …
            - BetaLocalShellToolParam — A tool that allows the model to execute shell commands in a local environment.
              - …
            - BetaFunctionShellToolParam — A tool that allows the model to execute shell commands.
              - …
            - BetaCustomToolParam — A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)
              - …
            - BetaNamespaceToolParam — Groups function/custom tools under a shared namespace.
              - …
            - BetaToolSearchToolParam — Hosted or BYOT tool search configuration for deferred tools.
              - …
            - BetaWebSearchPreviewTool — 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).
              - …
            - BetaApplyPatchToolParam — Allows the assistant to create, delete, or update files using unified diffs.
              - …
      - BetaCompactionBody — A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'compaction', required — The type of the item. Always `compaction`.
        - `id` string, required — The unique ID of the compaction item.
        - `encrypted_content` string, required — The encrypted content that was produced by compaction.
        - `created_by` string — The identifier of the actor that created the item.
      - BetaImageGenToolCall — An image generation request made by the model.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'image_generation_call', required — The type of the image generation call. Always `image_generation_call`.
        - `id` string, required — The unique ID of the image generation call.
        - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required — The status of the image generation call.
        - `result` string, nullable, required — The generated image encoded in base64.
      - BetaCodeInterpreterToolCall — A tool call to run code.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'code_interpreter_call', required — The type of the code interpreter tool call. Always `code_interpreter_call`.
        - `id` string, required — The unique ID of the code interpreter tool call.
        - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required — The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
        - `container_id` string, required — The ID of the container used to run the code.
        - `code` string, nullable, required — The code to run, or null if not available.
        - `outputs` union[], nullable, required — The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
          - union
            - BetaCodeInterpreterOutputLogs — The logs output from the code interpreter.
              - …
            - BetaCodeInterpreterOutputImage — The image output from the code interpreter.
              - …
      - BetaLocalShellToolCall — A tool call to run a command on the local shell.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'local_shell_call', required — The type of the local shell call. Always `local_shell_call`.
        - `id` string, required — The unique ID of the local shell call.
        - `call_id` string, required — The unique ID of the local shell tool call generated by the model.
        - `action` BetaLocalShellExecAction, required — Execute a shell command on the server.
          - `type` 'exec', required — The type of the local shell action. Always `exec`.
          - `command` string[], required — The command to run.
          - `timeout_ms` integer, nullable — Optional timeout in milliseconds for the command.
          - `working_directory` string, nullable — Optional working directory to run the command in.
          - `env` object, required — Environment variables to set for the command.
          - `user` string, nullable — Optional user to run the command as.
        - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the local shell call.
      - BetaLocalShellToolCallOutput — The output of a local shell tool call.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'local_shell_call_output', required — The type of the local shell tool call output. Always `local_shell_call_output`.
        - `id` string, required — The unique ID of the local shell tool call generated by the model.
        - `output` string, required — A JSON string of the output of the local shell tool call.
        - `status` 'in_progress' | 'completed' | 'incomplete', nullable — The status of the item. One of `in_progress`, `completed`, or `incomplete`.
      - BetaFunctionShellCall — A tool call that executes one or more shell commands in a managed environment.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'shell_call', required — The type of the item. Always `shell_call`.
        - `id` string, required — The unique ID of the shell tool call. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `action` BetaFunctionShellAction, required — Execute a shell command.
          - `commands` string[], required
          - `timeout_ms` integer, nullable, required — Optional timeout in milliseconds for the commands.
          - `max_output_length` integer, nullable, required — Optional maximum number of characters to return from each command.
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `environment` union, required
          - BetaLocalEnvironmentResource — Represents the use of a local environment to perform shell actions.
            - `type` 'local', required — The environment type. Always `local`.
          - BetaContainerReferenceResource — Represents a container created with /v1/containers.
            - `type` 'container_reference', required — The environment type. Always `container_reference`.
            - `container_id` string, required
        - `created_by` string — The ID of the entity that created this tool call.
      - BetaFunctionShellCallOutput — The output of a shell tool call that was emitted.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'shell_call_output', required — The type of the shell call output. Always `shell_call_output`.
        - `id` string, required — The unique ID of the shell call output. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `output` BetaFunctionShellCallOutputContent[], required — An array of shell call output contents
          - `stdout` string, required — The standard output that was captured.
          - `stderr` string, required — The standard error output that was captured.
          - `outcome` union, required — Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.
            - BetaFunctionShellCallOutputTimeoutOutcome — Indicates that the shell call exceeded its configured time limit.
              - …
            - BetaFunctionShellCallOutputExitOutcome — Indicates that the shell commands finished and returned an exit code.
              - …
          - `created_by` string — The identifier of the actor that created the item.
        - `max_output_length` integer, nullable, required — The maximum length of the shell command output. This is generated by the model and should be passed back with the raw output.
        - `created_by` string — The identifier of the actor that created the item.
      - BetaApplyPatchToolCall — A tool call that applies file diffs by creating, deleting, or updating files.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'apply_patch_call', required — The type of the item. Always `apply_patch_call`.
        - `id` string, required — The unique ID of the apply patch tool call. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `status` 'in_progress' | 'completed', required
        - `operation` union, required — One of the create_file, delete_file, or update_file operations applied via apply_patch.
          - BetaApplyPatchCreateFileOperation — Instruction describing how to create a file via the apply_patch tool.
            - `type` 'create_file', required — Create a new file with the provided diff.
            - `path` string, required — Path of the file to create.
            - `diff` string, required — Diff to apply.
          - BetaApplyPatchDeleteFileOperation — Instruction describing how to delete a file via the apply_patch tool.
            - `type` 'delete_file', required — Delete the specified file.
            - `path` string, required — Path of the file to delete.
          - BetaApplyPatchUpdateFileOperation — Instruction describing how to update a file via the apply_patch tool.
            - `type` 'update_file', required — Update an existing file with the provided diff.
            - `path` string, required — Path of the file to update.
            - `diff` string, required — Diff to apply.
        - `created_by` string — The ID of the entity that created this tool call.
      - BetaApplyPatchToolCallOutput — The output emitted by an apply patch tool call.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'apply_patch_call_output', required — The type of the item. Always `apply_patch_call_output`.
        - `id` string, required — The unique ID of the apply patch tool call output. Populated when this item is returned via API.
        - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `status` 'completed' | 'failed', required
        - `output` string, nullable — Optional textual output returned by the apply patch tool.
        - `created_by` string — The ID of the entity that created this tool call output.
      - BetaMCPToolCall — An invocation of a tool on an MCP server.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'mcp_call', required — The type of the item. Always `mcp_call`.
        - `id` string, required — The unique ID of the tool call.
        - `server_label` string, required — The label of the MCP server running the tool.
        - `name` string, required — The name of the tool that was run.
        - `arguments` string, required — A JSON string of the arguments passed to the tool.
        - `output` string, nullable — The output from the tool call.
        - `error` string, nullable — The error from the tool call, if any.
        - `status` 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed'
        - `approval_request_id` string, nullable — 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.
      - BetaMCPListTools — A list of tools available on an MCP server.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'mcp_list_tools', required — The type of the item. Always `mcp_list_tools`.
        - `id` string, required — The unique ID of the list.
        - `server_label` string, required — The label of the MCP server.
        - `tools` BetaMCPListToolsTool[], required — The tools available on the server.
          - `name` string, required — The name of the tool.
          - `description` string, nullable — The description of the tool.
          - `input_schema` object, required — The JSON schema describing the tool's input.
          - `annotations` object, nullable — Additional annotations about the tool.
        - `error` string, nullable — Error message if the server could not list tools.
      - BetaMCPApprovalRequest — A request for human approval of a tool invocation.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'mcp_approval_request', required — The type of the item. Always `mcp_approval_request`.
        - `id` string, required — The unique ID of the approval request.
        - `server_label` string, required — The label of the MCP server making the request.
        - `name` string, required — The name of the tool to run.
        - `arguments` string, required — A JSON string of arguments for the tool.
      - BetaMCPApprovalResponseResource — A response to an MCP approval request.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'mcp_approval_response', required — The type of the item. Always `mcp_approval_response`.
        - `id` string, required — The unique ID of the approval response
        - `approval_request_id` string, required — The ID of the approval request being answered.
        - `approve` boolean, required — Whether the request was approved.
        - `reason` string, nullable — Optional reason for the decision.
      - BetaCustomToolCall — A call to a custom tool created by the model.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'custom_tool_call', required — The type of the custom tool call. Always `custom_tool_call`.
        - `id` string — The unique ID of the custom tool call in the OpenAI platform.
        - `call_id` string, required — An identifier used to map this custom tool call to a tool call output.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCaller
            - `type` 'direct', required
          - BetaProgramToolCallCaller
            - `type` 'program', required
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `namespace` string — The namespace of the custom tool being called.
        - `name` string, required — The name of the custom tool being called.
        - `input` string, required — The input for the custom tool call generated by the model.
      - BetaCustomToolCallOutputResource — The output of a custom tool call from your code, being sent back to the model.
        - `agent` BetaAgentTag
          - `agent_name` string, required — The canonical name of the agent that produced this item.
        - `type` 'custom_tool_call_output', required — The type of the custom tool call output. Always `custom_tool_call_output`.
        - `id` string, required — The unique ID of the custom tool call output item.
        - `call_id` string, required — The call ID, used to map this custom tool call output to a custom tool call.
        - `caller` union — The execution context that produced this tool call.
          - BetaDirectToolCallCallerParam
            - `type` 'direct', required — The caller type. Always `direct`.
          - BetaProgramToolCallCallerParam
            - `type` 'program', required — The caller type. Always `program`.
            - `caller_id` string, required — The call ID of the program item that produced this tool call.
        - `output` union, required — The output from the custom tool call generated by your code. Can be a string or an list of output content.
          - string — A string of the output of the custom tool call.
          - BetaFunctionAndCustomToolCallOutput[] — Text, image, or file output of the custom tool call.
            - union
              - …
        - `status` 'in_progress' | 'completed' | 'incomplete', required
        - `created_by` string — The identifier of the actor that created the item.
  - `reasoning` BetaReasoning — **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
    - `mode` union
      - string
      - 'standard' | 'pro'
    - `effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max', nullable — Constrains effort on reasoning for reasoning models. Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Not all reasoning models support every value. See the [reasoning guide](https://platform.openai.com/docs/guides/reasoning) for model-specific support.
    - `summary` 'auto' | 'concise' | 'detailed', nullable — 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`.
    - `context` 'auto' | 'current_turn' | 'all_turns', nullable — Controls which reasoning items are rendered back to the model on later turns. If omitted or set to `auto`, the model determines the context mode. The `gpt-5.6` model family defaults to `all_turns`; earlier models default to `current_turn`. When returned on a response, this is the effective reasoning context mode used for the response.
    - `generate_summary` 'auto' | 'concise' | 'detailed', nullable — **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`.
  - `instructions` union, required
    - string — A text input to the model, equivalent to a text input with the `developer` role.
    - BetaInputItem[] — A list of one or many input items to the model, containing different content types.
      - union
        - BetaEasyInputMessage — 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.
          - `role` 'user' | 'assistant' | 'system' | 'developer', required — The role of the message input. One of `user`, `assistant`, `system`, or `developer`.
          - `content` union, required — Text, image, or audio input to the model, used to generate a response. Can also contain previous assistant responses.
            - string — A text input to the model.
            - BetaInputContent[] — A list of one or many input items to the model, containing different content types.
              - …
          - `phase` 'commentary' | '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.
          - `type` 'message' — The type of the message input. Always `message`.
        - union — Content item used to generate a response.
          - object — 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.
            - `agent` BetaAgentTag
              - …
            - `type` 'message' — The type of the message input. Always set to `message`.
            - `role` 'user' | 'system' | 'developer', required — The role of the message input. One of `user`, `system`, or `developer`.
            - `status` 'in_progress' | 'completed' | 'incomplete' — The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
            - `content` BetaInputContent[], required — A list of one or many input items to the model, containing different content types.
              - …
          - object — An output message from the model.
            - `agent` BetaAgentTag
              - …
            - `id` string, required — The unique ID of the output message.
            - `type` 'message', required — The type of the output message. Always `message`.
            - `role` 'assistant', required — The role of the output message. Always `assistant`.
            - `content` BetaOutputMessageContent[], required — The content of the output message.
              - …
            - `phase` 'commentary' | '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.
            - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API.
          - object — The results of a file search tool call. See the [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.
            - `agent` BetaAgentTag
              - …
            - `id` string, required — The unique ID of the file search tool call.
            - `type` 'file_search_call', required — The type of the file search tool call. Always `file_search_call`.
            - `status` 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed', required — The status of the file search tool call. One of `in_progress`, `searching`, `incomplete` or `failed`,
            - `queries` string[], required — The queries used to search for files.
            - `results` object[], nullable — The results of the file search tool call.
              - …
          - object — A tool call to a computer use tool. See the [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.
            - `agent` BetaAgentTag
              - …
            - `type` 'computer_call', required — The type of the computer call. Always `computer_call`.
            - `id` string, required — The unique ID of the computer call.
            - `call_id` string, required — An identifier used when responding to the tool call with output.
            - `action` union
              - …
            - `actions` BetaComputerAction[] — Flattened batched actions for `computer_use`. Each action includes an `type` discriminator and action-specific fields.
              - …
            - `pending_safety_checks` BetaComputerCallSafetyCheckParam[], required — The pending safety checks for the computer call.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
          - object — The output of a computer tool call.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The ID of the computer tool call output.
            - `call_id` string, required — The ID of the computer tool call that produced the output.
            - `type` 'computer_call_output', required — The type of the computer tool call output. Always `computer_call_output`.
            - `output` BetaComputerScreenshotImage, required — A computer screenshot image used with the computer use tool.
              - …
            - `acknowledged_safety_checks` BetaComputerCallSafetyCheckParam[], nullable — The safety checks reported by the API that have been acknowledged by the developer.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete'
          - object — The results of a web search tool call. See the [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.
            - `agent` BetaAgentTag
              - …
            - `id` string, required — The unique ID of the web search tool call.
            - `type` 'web_search_call', required — The type of the web search tool call. Always `web_search_call`.
            - `status` 'in_progress' | 'searching' | 'completed' | 'failed', required — The status of the web search tool call.
            - `action` union, required — 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).
              - …
          - object — A tool call to run a function. See the [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.
            - `agent` BetaAgentTag
              - …
            - `id` string — The unique ID of the function tool call.
            - `type` 'function_call', required — The type of the function tool call. Always `function_call`.
            - `call_id` string, required — The unique ID of the function tool call generated by the model.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `namespace` string — The namespace of the function to run.
            - `name` string, required — The name of the function to run.
            - `arguments` string, required — A JSON string of the arguments to pass to the function.
            - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
          - object — The output of a function tool call.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of the function tool call output. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the function tool call generated by the model.
            - `type` 'function_call_output', required — The type of the function tool call output. Always `function_call_output`.
            - `output` union, required — Text, image, or file output of the function tool call.
              - …
            - `caller` union — The execution context that produced this tool call.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete'
          - object — A message routed between agents.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this agent message item.
            - `type` 'agent_message', required — The item type. Always `agent_message`.
            - `author` string, required — The sending agent identity.
            - `recipient` string, required — The destination agent identity.
            - `content` union[], required — Plaintext, image, or encrypted content sent between agents.
              - …
          - object
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this multi-agent call.
            - `call_id` string, required — The unique ID linking this call to its output.
            - `type` 'multi_agent_call', required — The item type. Always `multi_agent_call`.
            - `action` 'spawn_agent' | 'interrupt_agent' | 'list_agents' | 'send_message' | 'followup_task' | 'wait_agent', required
            - `arguments` string, required — The action arguments as a JSON string.
          - object
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this multi-agent call output.
            - `call_id` string, required — The unique ID of the multi-agent call.
            - `type` 'multi_agent_call_output', required — The item type. Always `multi_agent_call_output`.
            - `action` 'spawn_agent' | 'interrupt_agent' | 'list_agents' | 'send_message' | 'followup_task' | 'wait_agent', required
            - `output` BetaOutputTextContentParam[], required — Text output returned by the multi-agent action.
              - …
          - object
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this tool search call.
            - `call_id` string, nullable — The unique ID of the tool search call generated by the model.
            - `type` 'tool_search_call', required — The item type. Always `tool_search_call`.
            - `execution` 'server' | 'client'
            - `arguments` BetaEmptyModelParam, required
            - `status` 'in_progress' | 'completed' | 'incomplete'
          - object
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this tool search output.
            - `call_id` string, nullable — The unique ID of the tool search call generated by the model.
            - `type` 'tool_search_output', required — The item type. Always `tool_search_output`.
            - `execution` 'server' | 'client'
            - `tools` BetaTool[], required — The loaded tool definitions returned by the tool search output.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete'
          - object
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of this additional tools item.
            - `type` 'additional_tools', required — The item type. Always `additional_tools`.
            - `role` 'developer', required — The role that provided the additional tools. Only `developer` is supported.
            - `tools` BetaTool[], required — A list of additional tools made available at this item.
              - …
          - 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](https://platform.openai.com/docs/guides/conversation-state).
            - `agent` BetaAgentTag
              - …
            - `type` 'reasoning', required — The type of the object. Always `reasoning`.
            - `id` string, required — The unique identifier of the reasoning content.
            - `encrypted_content` string, nullable — The encrypted content of the reasoning item. This is populated by default for reasoning items returned by `POST /v1/responses` and WebSocket `response.create` requests.
            - `summary` BetaSummaryTextContent[], required — Reasoning summary content.
              - …
            - `content` BetaReasoningTextContent[] — Reasoning text content.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete' — The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API.
          - object — A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The ID of the compaction item.
            - `type` 'compaction', required — The type of the item. Always `compaction`.
            - `encrypted_content` string, required — The encrypted content of the compaction summary.
          - object — An image generation request made by the model.
            - `agent` BetaAgentTag
              - …
            - `type` 'image_generation_call', required — The type of the image generation call. Always `image_generation_call`.
            - `id` string, required — The unique ID of the image generation call.
            - `status` 'in_progress' | 'completed' | 'generating' | 'failed', required — The status of the image generation call.
            - `result` string, nullable, required — The generated image encoded in base64.
          - object — A tool call to run code.
            - `agent` BetaAgentTag
              - …
            - `type` 'code_interpreter_call', required — The type of the code interpreter tool call. Always `code_interpreter_call`.
            - `id` string, required — The unique ID of the code interpreter tool call.
            - `status` 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed', required — The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`.
            - `container_id` string, required — The ID of the container used to run the code.
            - `code` string, nullable, required — The code to run, or null if not available.
            - `outputs` union[], nullable, required — The outputs generated by the code interpreter, such as logs or images. Can be null if no outputs are available.
              - …
          - object — A tool call to run a command on the local shell.
            - `agent` BetaAgentTag
              - …
            - `type` 'local_shell_call', required — The type of the local shell call. Always `local_shell_call`.
            - `id` string, required — The unique ID of the local shell call.
            - `call_id` string, required — The unique ID of the local shell tool call generated by the model.
            - `action` BetaLocalShellExecAction, required — Execute a shell command on the server.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete', required — The status of the local shell call.
          - object — The output of a local shell tool call.
            - `agent` BetaAgentTag
              - …
            - `type` 'local_shell_call_output', required — The type of the local shell tool call output. Always `local_shell_call_output`.
            - `id` string, required — The unique ID of the local shell tool call generated by the model.
            - `output` string, required — A JSON string of the output of the local shell tool call.
            - `status` 'in_progress' | 'completed' | 'incomplete', nullable — The status of the item. One of `in_progress`, `completed`, or `incomplete`.
          - object — A tool representing a request to execute one or more shell commands.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of the shell tool call. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the shell tool call generated by the model.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `type` 'shell_call', required — The type of the item. Always `shell_call`.
            - `action` BetaFunctionShellActionParam, required — Commands and limits describing how to run the shell tool call.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete' — Status values reported for shell tool calls.
            - `environment` union
              - …
          - object — The streamed output items emitted by a shell tool call.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `id` string, nullable — The unique ID of the shell tool call output. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the shell tool call generated by the model.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `type` 'shell_call_output', required — The type of the item. Always `shell_call_output`.
            - `output` BetaFunctionShellCallOutputContentParam[], required — Captured chunks of stdout and stderr output, along with their associated outcomes.
              - …
            - `status` 'in_progress' | 'completed' | 'incomplete' — Status values reported for shell tool calls.
            - `max_output_length` integer, nullable — The maximum number of UTF-8 characters captured for this shell call's combined output.
          - object — A tool call representing a request to create, delete, or update files using diff patches.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `type` 'apply_patch_call', required — The type of the item. Always `apply_patch_call`.
            - `id` string, nullable — The unique ID of the apply patch tool call. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `status` 'in_progress' | 'completed', required — Status values reported for apply_patch tool calls.
            - `operation` union, required — One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool.
              - …
          - object — The streamed output emitted by an apply patch tool call.
            - `agent` BetaAgentTagParam — The agent that produced this item.
              - …
            - `type` 'apply_patch_call_output', required — The type of the item. Always `apply_patch_call_output`.
            - `id` string, nullable — The unique ID of the apply patch tool call output. Populated when this item is returned via API.
            - `call_id` string, required — The unique ID of the apply patch tool call generated by the model.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `status` 'completed' | 'failed', required — Outcome values reported for apply_patch tool call outputs.
            - `output` string, nullable — Optional human-readable log text from the apply patch tool (e.g., patch results or errors).
          - object — A list of tools available on an MCP server.
            - `agent` BetaAgentTag
              - …
            - `type` 'mcp_list_tools', required — The type of the item. Always `mcp_list_tools`.
            - `id` string, required — The unique ID of the list.
            - `server_label` string, required — The label of the MCP server.
            - `tools` BetaMCPListToolsTool[], required — The tools available on the server.
              - …
            - `error` string, nullable — Error message if the server could not list tools.
          - object — A request for human approval of a tool invocation.
            - `agent` BetaAgentTag
              - …
            - `type` 'mcp_approval_request', required — The type of the item. Always `mcp_approval_request`.
            - `id` string, required — The unique ID of the approval request.
            - `server_label` string, required — The label of the MCP server making the request.
            - `name` string, required — The name of the tool to run.
            - `arguments` string, required — A JSON string of arguments for the tool.
          - object — A response to an MCP approval request.
            - `agent` BetaAgentTag
              - …
            - `type` 'mcp_approval_response', required — The type of the item. Always `mcp_approval_response`.
            - `id` string, nullable — The unique ID of the approval response
            - `approval_request_id` string, required — The ID of the approval request being answered.
            - `approve` boolean, required — Whether the request was approved.
            - `reason` string, nullable — Optional reason for the decision.
          - object — An invocation of a tool on an MCP server.
            - `agent` BetaAgentTag
              - …
            - `type` 'mcp_call', required — The type of the item. Always `mcp_call`.
            - `id` string, required — The unique ID of the tool call.
            - `server_label` string, required — The label of the MCP server running the tool.
            - `name` string, required — The name of the tool that was run.
            - `arguments` string, required — A JSON string of the arguments passed to the tool.
            - `output` string, nullable — The output from the tool call.
            - `error` string, nullable — The error from the tool call, if any.
            - `status` 'in_progress' | 'completed' | 'incomplete' | 'calling' | 'failed'
            - `approval_request_id` string, nullable — 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.
          - object — The output of a custom tool call from your code, being sent back to the model.
            - `agent` BetaAgentTag
              - …
            - `type` 'custom_tool_call_output', required — The type of the custom tool call output. Always `custom_tool_call_output`.
            - `id` string — The unique ID of the custom tool call output in the OpenAI platform.
            - `call_id` string, required — The call ID, used to map this custom tool call output to a custom tool call.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `output` union, required — The output from the custom tool call generated by your code. Can be a string or an list of output content.
              - …
          - object — A call to a custom tool created by the model.
            - `agent` BetaAgentTag
              - …
            - `type` 'custom_tool_call', required — The type of the custom tool call. Always `custom_tool_call`.
            - `id` string — The unique ID of the custom tool call in the OpenAI platform.
            - `call_id` string, required — An identifier used to map this custom tool call to a tool call output.
            - `caller` union — The execution context that produced this tool call.
              - …
            - `namespace` string — The namespace of the custom tool being called.
            - `name` string, required — The name of the custom tool being called.
            - `input` string, required — The input for the custom tool call generated by the model.
        - BetaCompactionTriggerItemParam — Compacts the current context. Must be the final input item.
          - `agent` BetaAgentTagParam — The agent that produced this item.
            - `agent_name` string, required — The canonical name of the agent that produced this item.
          - `type` 'compaction_trigger', required — The type of the item. Always `compaction_trigger`.
        - BetaItemReferenceParam — An internal identifier for an item to reference.
          - `agent` BetaAgentTagParam — The agent that produced this item.
            - `agent_name` string, required — The canonical name of the agent that produced this item.
          - `type` 'item_reference', nullable — The type of item to reference. Always `item_reference`.
          - `id` string, required — The ID of the item to reference.
        - BetaProgramItemParam
          - `agent` BetaAgentTagParam — The agent that produced this item.
            - `agent_name` string, required — The canonical name of the agent that produced this item.
          - `id` string, required — The unique ID of this program item.
          - `type` 'program', required — The item type. Always `program`.
          - `call_id` string, required — The stable call ID of the program item.
          - `code` string, required — The JavaScript source executed by programmatic tool calling.
          - `fingerprint` string, required — Opaque program replay fingerprint that must be round-tripped.
        - BetaProgramOutputItemParam
          - `agent` BetaAgentTagParam — The agent that produced this item.
            - `agent_name` string, required — The canonical name of the agent that produced this item.
          - `id` string, required — The unique ID of this program output item.
          - `type` 'program_output', required — The item type. Always `program_output`.
          - `call_id` string, required — The call ID of the program item.
          - `result` string, required — The result produced by the program item.
          - `status` 'completed' | 'incomplete', required
  - `output_text` string, nullable — SDK-only convenience property that contains the aggregated text output from all `output_text` items in the `output` array, if any are present. Supported in the Python and JavaScript SDKs.
  - `usage` BetaResponseUsage — Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.
    - `input_tokens` integer, required — The number of input tokens.
    - `input_tokens_details` object, required — A detailed breakdown of the input tokens.
      - `cached_tokens` integer, required — The number of tokens that were retrieved from the cache. [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching).
      - `cache_write_tokens` integer, required — The number of input tokens that were written to the cache.
    - `output_tokens` integer, required — The number of output tokens.
    - `output_tokens_details` object, required — A detailed breakdown of the output tokens.
      - `reasoning_tokens` integer, required — The number of reasoning tokens.
    - `total_tokens` integer, required — The total number of tokens used.
  - `prompt_cache_options` BetaPromptCacheOptions — The prompt-caching options that were applied to the response. Supported for `gpt-5.6` and later models.
    - `ttl` '30m', required
    - `mode` 'implicit' | 'explicit', required
  - `moderation` BetaModeration — Moderation results or errors for the response input and output.
    - `input` union, required — Moderation for the response input.
      - BetaModerationResultBody — A moderation result produced for the response input or output.
        - `type` 'moderation_result', required — The object type, which was always `moderation_result` for successful moderation results.
        - `model` string, required — The moderation model that produced this result.
        - `flagged` boolean, required — A boolean indicating whether the content was flagged by any category.
        - `categories` object, required — A dictionary of moderation categories to booleans, True if the input is flagged under this category.
        - `category_scores` object, required — A dictionary of moderation categories to scores.
        - `category_applied_input_types` object, required — Which modalities of input are reflected by the score for each category.
      - BetaModerationErrorBody — An error produced while attempting moderation for the response input or output.
        - `type` 'error', required — The object type, which was always `error` for moderation failures.
        - `code` string, required — The error code.
        - `message` string, required — The error message.
    - `output` union, required — Moderation for the response output.
      - BetaModerationResultBody — A moderation result produced for the response input or output.
        - `type` 'moderation_result', required — The object type, which was always `moderation_result` for successful moderation results.
        - `model` string, required — The moderation model that produced this result.
        - `flagged` boolean, required — A boolean indicating whether the content was flagged by any category.
        - `categories` object, required — A dictionary of moderation categories to booleans, True if the input is flagged under this category.
        - `category_scores` object, required — A dictionary of moderation categories to scores.
        - `category_applied_input_types` object, required — Which modalities of input are reflected by the score for each category.
      - BetaModerationErrorBody — An error produced while attempting moderation for the response input or output.
        - `type` 'error', required — The object type, which was always `error` for moderation failures.
        - `code` string, required — The error code.
        - `message` string, required — The error message.
  - `parallel_tool_calls` boolean, required — Whether to allow the model to run tool calls in parallel.
  - `conversation` BetaConversation2 — The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.
    - `id` string, required — The unique ID of the conversation that this response was associated with.
  - `max_output_tokens` integer, nullable — An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).

---

[API](https://skmtc.net/openai/apis/openai-api.md) · [All operations](https://skmtc.net/openai/apis/openai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openai/openai-api/versions/dcd35773a322/schema)
